Closed
Description
Consider this simple project:
lib.rs:
#![allow(clippy::redundant_field_names)]
pub mod inner;
inner.rs:
pub struct Foo {
pub field: i32,
}
pub fn bar() -> Foo {
let field = 0;
Foo {
field: field,
}
}
Running cargo clippy
using stable 1.44.0 results in a redundant field name lint even though that lint has been disabled at the crate level:
Checking foo v0.1.0 (/Users/sfackler/foo)
warning: redundant field names in struct initialization
--> src/inner.rs:8:9
|
8 | field: field,
| ^^^^^^^^^^^^ help: replace it with: `field`
|
= note: `#[warn(clippy::redundant_field_names)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
This does not happen with earlier 1.43.1 or other earlier releases.
If the module definition is inlined into lib.rs, the lint does not trigger:
#![allow(clippy::redundant_field_names)]
pub mod inner {
pub struct Foo {
pub field: i32,
}
pub fn bar() -> Foo {
let field = 0;
Foo {
field: field,
}
}
}
Metadata
Metadata
Assignees
Labels
No labels