mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
26cf3eee16
* Don't check for repetition if the previous module crosses a body boundary. * Don't take a snippet of the entire item. * Check each item's visibility once. * Use `is_from_proc_macro` before linting
51 lines
762 B
Rust
51 lines
762 B
Rust
#![warn(clippy::module_inception)]
|
|
|
|
pub mod foo2 {
|
|
pub mod bar2 {
|
|
pub mod bar2 {
|
|
//~^ module_inception
|
|
|
|
pub mod foo2 {}
|
|
}
|
|
pub mod foo2 {}
|
|
}
|
|
pub mod foo2 {
|
|
//~^ module_inception
|
|
|
|
pub mod bar2 {}
|
|
}
|
|
}
|
|
|
|
mod foo {
|
|
mod bar {
|
|
mod bar {
|
|
//~^ module_inception
|
|
|
|
mod foo {}
|
|
}
|
|
mod foo {}
|
|
}
|
|
mod foo {
|
|
//~^ module_inception
|
|
|
|
mod bar {}
|
|
}
|
|
}
|
|
|
|
// No warning. See <https://github.com/rust-lang/rust-clippy/issues/1220>.
|
|
mod bar {
|
|
#[allow(clippy::module_inception)]
|
|
mod bar {}
|
|
}
|
|
|
|
mod with_inner_impl {
|
|
struct S;
|
|
impl S {
|
|
fn f() {
|
|
mod with_inner_impl {}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|