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
error: obsolete syntax: `priv` not necessary
note: an item without a visibility qualifier is private by default
This is wrong in all those cases, as the said items are not private by default. In case of Error 1, the visibility is set by the visibility of the trait. In case of Error 2, there's no such thing as a private implementation, you're meant to put visibility on individual functions. In case of Error 3 there's no such thing as a private implementation of a trait, but unlike Error 2 you're not allowed to put visibility on individual functions as the visibility is inherited from the implemented trait. Error 4, thus, is also wrong. Obviously if the priv keyword goes (#8122) then these are invalidated.
The other problematic error comes from this code:
structS;traitA{fnfoo();}pubimplAforS// Error 5{}
The error text:
error: obsolete syntax: visibility-qualified implementation
note: `pub` or `priv` goes on individual functions; remove the `pub` or `priv`
This is not correct, as you're not allowed to put it on the individual functions either.
The text was updated successfully, but these errors were encountered:
…walton
This fixes private statics and functions from being usable cross-crates, along
with some bad privacy error messages. This is a reopening of #8365 with all the
privacy checks in privacy.rs instead of resolve.rs (where they should be
anyway).
These maps of exported items will hopefully get used for generating
documentation by rustdoc
Closes#8592
Do not fire `panic` in a constant environment
Let rustc handle panics in constant environments.
Since rust-lang/rust-clippy#8348 I thought that such modification would require a lot of work but thanks to rust-lang/rust-clippy#8588 I now know that it is not the case.
changelog: [`panic`]: No longer lint in constant context. `rustc` already handles this.
There are two sets of problematic messages here. First, take this code:
All of the marked lines give this error:
This is wrong in all those cases, as the said items are not private by default. In case of Error 1, the visibility is set by the visibility of the trait. In case of Error 2, there's no such thing as a private implementation, you're meant to put visibility on individual functions. In case of Error 3 there's no such thing as a private implementation of a trait, but unlike Error 2 you're not allowed to put visibility on individual functions as the visibility is inherited from the implemented trait. Error 4, thus, is also wrong. Obviously if the priv keyword goes (#8122) then these are invalidated.
The other problematic error comes from this code:
The error text:
This is not correct, as you're not allowed to put it on the individual functions either.
The text was updated successfully, but these errors were encountered: