Uplift module inspect from clippy by chenyukang · Pull Request #147599 · rust-lang/rust (original) (raw)
Fixes #141385
r? @estebank
I added a group BuiltinCombinedLateLintPass is because module_lints is 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_inception option in clippy..