We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
The text was updated successfully, but these errors were encountered:
The following tests fail (due to different error message), if variants visibility modifiers are forbidden:
test [compile-fail] compile-fail/issue-3993-2.rs ... FAILED test [compile-fail] compile-fail/useless-priv.rs ... FAILED
Sorry, something went wrong.
I’m fine with making this change without an RFC, but we should still run a crater run with change applied.
libsyntax: forbid visibility modifiers for enum variants
99f2a68
fixes rust-lang#28433
e3be84c
Successfully merging a pull request may close this issue.
The following code compiles without warnings:
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
The text was updated successfully, but these errors were encountered: