-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Uplift module inception from clippy #147599
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
e7391b2 to
097f2b5
Compare
This comment has been minimized.
This comment has been minimized.
097f2b5 to
37d7d36
Compare
|
This PR modifies If appropriate, please update |
This comment has been minimized.
This comment has been minimized.
37d7d36 to
9260423
Compare
This comment has been minimized.
This comment has been minimized.
9260423 to
344bbb7
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
I think we should allow private module inception by default, maybe just not even add it, because a common move is to do this to define your public API: // lib.rs
pub mod module;// module.rs
#[cfg(whatever)]
mod module {
}
#[cfg(not(whatever))]
mod module {
}
pub use module::*;You rarely want to think of a new name for the inner module, For configuring them: we could make them separate lints. We could also crater-run it with the private module inception on deny-by-default vs. crater-running it with allow-by-default to see the difference. |
Fixes #141385
r? @estebank
I added a group
BuiltinCombinedLateLintPassis becausemodule_lintsis run per-module:https://github.com/chenyukang/rust/blob/e7391b2f97ecb889cf48a1e83732bef64db0a575/compiler/rustc_lint/src/late.rs#L468-L471
but this check needs a recursive way so it's in crate_lints.
I'd like to make sure everything is OK in rustc lint before we remove it from clippy.
One thing I'm worried is this may report warning for those project without clippy checking, since now it's a builtin check and default is
warn.It's better to keep the same behavior with clippy, so how do we handle
allow_private_module_inceptionoption in clippy..