Closed
Description
The following code compiles without warnings:
#[allow(dead_code)]
enum Foo {
pub Spam,
Eggs
}
fn main() {
}
I guess that this should be forbidden, because enum vairants inherit visibility of the enum itself. At minimum, this should produce a warning.
This is the relevant line from parser: https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs#L5203
This is the discussion on Rust forum: https://users.rust-lang.org/t/confused-about-enum-variants-visibility/2873
Metadata
Metadata
Assignees
Labels
No labels