pub static UNUSED_TUPLE_STRUCT_FIELDS: &Lint
Expand description

The unused_tuple_struct_fields lint detects fields of tuple structs that are never read.

Example

#[warn(unused_tuple_struct_fields)]
struct S(i32, i32, i32);
let s = S(1, 2, 3);
let _ = (s.0, s.2);

{{produces}}

Explanation

Tuple struct fields that are never read anywhere may indicate a mistake or unfinished code. To silence this warning, consider removing the unused field(s) or, to preserve the numbering of the remaining fields, change the unused field(s) to have unit type.