-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Wrong compiler suggestion for no_mangle statics inside private module #47383
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Jan 16, 2018
The incompetent fool who added these suggestions in 38e5a96 apparently thought it was safe to assume that, because the offending function or static was unreachable, it would therefore have not have any existing visibility modifiers, making it safe for us to unconditionally suggest inserting `pub`. This isn't true. This resolves rust-lang#47383.
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Jan 17, 2018
…ested_double-pub, r=estebank private no-mangle lints: only suggest `pub` if it doesn't already exist Fixes rust-lang#47383 (function or static can be `pub` but unreachable because it's in a private module; adding another `pub` is nonsensical). r? @estebank
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Jan 17, 2018
…ested_double-pub, r=estebank private no-mangle lints: only suggest `pub` if it doesn't already exist Fixes rust-lang#47383 (function or static can be `pub` but unreachable because it's in a private module; adding another `pub` is nonsensical). r? @estebank
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Jul 1, 2018
This is probably quite a lot less likely to come up in practice than the "inherited" (no visibility keyword) case, but now that we have visibility spans in the HIR, we can do this, and it presumably doesn't hurt to be exhaustive. (Who can say but that the attention to detail just might knock someone's socks off, someday, somewhere?) This is inspired by rust-lang#47383.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Defining a
pub
static inside a private module like thisyields the following warning:
The suggestion wrongly tells us to add a
pub
to the already publicFOO
.(playpen)
The text was updated successfully, but these errors were encountered: