Skip to content

Nitpicking: visibility errors on a tuple struct count fields from 1 when the language counts them from 0 #31706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nodakai opened this issue Feb 16, 2016 · 1 comment · Fixed by #31721

Comments

@nodakai
Copy link
Contributor

nodakai commented Feb 16, 2016

mod m {
    pub struct S(i32);
    pub const K: S = S(0);
}

fn main() {
    0 == m::K.0;
}
<anon>:7:10: 7:16 error: field #1 of struct `m::S` is private [E0451]
<anon>:7     0 == m::K.0;
                  ^~~~~~
<anon>:7:10: 7:16 help: see the detailed explanation for E0451
rphmeier added a commit to rphmeier/rust that referenced this issue Feb 17, 2016
@rphmeier
Copy link
Contributor

I don't know if this needs "fixing", but I've "fixed" it and can submit a PR if desired.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 19, 2016
…anishearth

Fixes rust-lang#31706

Also fixes a phrasing error in the diagnostic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants