2016-08-16 14:29:21 +02:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(module_inception)]
|
|
|
|
|
|
|
|
mod foo {
|
|
|
|
mod bar {
|
2016-09-12 10:30:42 +02:00
|
|
|
pub mod bar { //~ ERROR item has the same name as its containing module
|
2016-08-16 14:36:48 +02:00
|
|
|
mod foo {}
|
2016-08-16 14:29:21 +02:00
|
|
|
}
|
2016-08-16 14:36:48 +02:00
|
|
|
mod foo {}
|
2016-08-16 14:29:21 +02:00
|
|
|
}
|
2016-09-12 10:30:42 +02:00
|
|
|
pub mod foo { //~ ERROR item has the same name as its containing module
|
2016-08-16 14:36:48 +02:00
|
|
|
mod bar {}
|
2016-08-16 14:29:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-12 10:30:42 +02:00
|
|
|
mod cake {
|
|
|
|
mod cake {
|
|
|
|
// no error, since module is not public
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-09 21:40:30 +02:00
|
|
|
// No warning. See <https://github.com/Manishearth/rust-clippy/issues/1220>.
|
|
|
|
mod bar {
|
|
|
|
#[allow(module_inception)]
|
2016-09-12 10:30:42 +02:00
|
|
|
pub mod bar {
|
2016-09-09 21:40:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-16 14:29:21 +02:00
|
|
|
fn main() {}
|