mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 11:13:43 +00:00
850c24edd3
This lint was triggering on modules inside expanded attrs, like for example `#[cfg(test)]` and possibly more.
27 lines
400 B
Rust
27 lines
400 B
Rust
// compile-flags: --test
|
|
|
|
#![warn(clippy::module_name_repetitions)]
|
|
#![allow(dead_code)]
|
|
|
|
mod foo {
|
|
pub fn foo() {}
|
|
pub fn foo_bar() {}
|
|
pub fn bar_foo() {}
|
|
pub struct FooCake {}
|
|
pub enum CakeFoo {}
|
|
pub struct Foo7Bar;
|
|
|
|
// Should not warn
|
|
pub struct Foobar;
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test {
|
|
#[test]
|
|
fn it_works() {
|
|
assert_eq!(2 + 2, 4);
|
|
}
|
|
}
|
|
|
|
fn main() {}
|