rust/tests/compile-fail/module_inception.rs

31 lines
574 B
Rust
Raw Normal View History

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