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
Attempting to "pub use module::privatetrait" fails with "trait is private", but it is then possible to use the trait from another crate.
// lib.rs#[crate_type="lib"];#[link(name="library", vers="0.0", package_id="library")];#[feature(globs)];//This does not export privatetrait.pubuse module::*;//This fails with "privatetrait is private"//pub use module::privatetrait;pubmod module {traitprivatetrait{fnprivate();}pubtraitpublictrait{fnpublic();}}
// main.rsexternmod library;structbugfinder;//This does not work (and shouldn't). privatetrait is not exported/*impl library::privatetrait for bugfinder { fn private() { }}*///This works (and shouldn't).impl library::module::privatetraitforbugfinder{fnprivate(){}}//This works (and should).impl library::publictraitforbugfinder{fnpublic(){}}fnmain(){}
This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.
Closes#10857
…-doc, r=flip1995
Explain which paths clippy searches for configuration in docs
Fixesrust-lang/rust-clippy#9921.
Adds information on where to place the configuration files, it may be a bit verbose. Also added a comment to the section of the code where the search happens, to hopefully prevent changing that without updating the docs.
changelog: Make documentation about where to place configuration files clearer.
Attempting to "pub use module::privatetrait" fails with "trait is private", but it is then possible to use the trait from another crate.
(
lib.rs
is one crate,main.rs
is another.)This was compiled with master as of 67aca9c.
The text was updated successfully, but these errors were encountered: