Summary
This lint should not be triggered on code generated by macros, but right now it is
Lint Name
redundant_field_names
Reproducer
I tried this code:
#[derive(Debug, thiserror::Error)]
pub enum SegmentDownloadingError {
// ...
/// Segment reconstruction error
#[error("Segment reconstruction error: {source}")]
SegmentReconstruction {
#[from]
source: ReconstructorError,
},
}
Internally it is expanded to things like this:
#[allow(deprecated, unused_qualifications, )]
#[automatically_derived]
impl ::core::convert::From<ReconstructorError> for SegmentDownloadingError {
fn from(source: ReconstructorError) -> Self {
SegmentDownloadingError::SegmentReconstruction {
source: source,
}
}
}
I saw this happen:
warning: redundant field names in struct initialization
--> crates/shared/ab-data-retrieval/src/segment_downloading.rs:48:9
|
48 | / #[from]
49 | | source: ReconstructorError,
| |______________^ help: replace it with: `source`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
I expected to see this happen:
No lint should be triggered since it is outside of developer's control and generated by proc macro.
Version
rustc 1.99.0-nightly (1a98b1e13 2026-08-07)
binary: rustc
commit-hash: 1a98b1e135b254f209c67d447b6d8bcd56a859e0
commit-date: 2026-08-07
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 23.1.0
Additional Labels
No response
Summary
This lint should not be triggered on code generated by macros, but right now it is
Lint Name
redundant_field_names
Reproducer
I tried this code:
Internally it is expanded to things like this:
I saw this happen:
I expected to see this happen:
No lint should be triggered since it is outside of developer's control and generated by proc macro.
Version
Additional Labels
No response