Summary
ref is sometimes used by proc macros, notably by https://crates.io/crates/parity-scale-codec-derive.
Considering the main stated concern of the lint being clarity of the code, it simply doesn't apply to generated code annotated with #[automatically_derived] attribute.
Lint Name
ref_patterns
Reproducer
No response
Version
rustc 1.97.0-nightly (20de910db 2026-05-02)
binary: rustc
commit-hash: 20de910db49d3476ccf49ea79a4b22e2b5dface0
commit-date: 2026-05-02
host: x86_64-unknown-linux-gnu
release: 1.97.0-nightly
LLVM version: 22.1.4
Additional Labels
No response
Summary
refis sometimes used by proc macros, notably by https://crates.io/crates/parity-scale-codec-derive.Considering the main stated concern of the lint being clarity of the code, it simply doesn't apply to generated code annotated with
#[automatically_derived]attribute.Lint Name
ref_patterns
Reproducer
No response
Version
Additional Labels
No response