You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 resolvesrust-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
Fixesrust-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
Fixesrust-lang#47383 (function or static can be `pub` but unreachable because it's in a private module; adding another `pub` is nonsensical).
r? @estebank
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.
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: