Skip to content

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

Closed
@nodakai

Description

@nodakai
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions