about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-toml/module_inception/module_inception.rs
blob: 94866a7e81bfca16179d41884e9b8777ef81b4b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#![warn(clippy::module_inception)]

// Lint
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 {}
    }
}

// Don't lint
mod foo {
    pub mod bar {
        pub mod foo {
            pub mod bar {}
        }
    }
    pub mod foo {
        pub mod bar {}
    }
}

// No warning. See <https://github.com/rust-lang/rust-clippy/issues/1220>.
pub mod bar {
    #[allow(clippy::module_inception)]
    pub mod bar {}
}

fn main() {}