-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.