Closed
Description
const LEN: usize = 4;
#[derive(Debug)]
struct Wrapper([u8; LEN]);
fn main() {
println!("{:?}", Wrapper([0, 1, 2, 3]));
}
warning: constant item is never used: `LEN`
--> src/main.rs:1:1
|
1 | const LEN: usize = 4;
| ^^^^^^^^^^^^^^^^^^^^^
If the struct is a record struct with a named field, the false positive doesn't trigger.