1 #![deny(unused_tuple_struct_fields)]
2 //~^ NOTE: the lint level is defined here
4 use std::marker::PhantomData;
8 struct SingleUnused(i32, [u8; LEN], String);
9 //~^ ERROR: field `1` is never read
10 //~| NOTE: field in this struct
11 //~| HELP: consider changing the field to be of unit type
13 struct MultipleUnused(i32, f32, String, u8);
14 //~^ ERROR: fields `0`, `1`, `2`, and `3` are never read
15 //~| NOTE: fields in this struct
16 //~| HELP: consider changing the fields to be of unit type
20 struct GoodPhantom(PhantomData<i32>);
23 struct GoodVoid(Void);
26 let w = SingleUnused(42, [0, 1, 2, 3], "abc".to_string());
30 let m = MultipleUnused(42, 3.14, "def".to_string(), 4u8);
32 let gu = GoodUnit(());
33 let gp = GoodPhantom(PhantomData);
34 let gv = GoodVoid(Void);
36 let _ = (gu, gp, gv, m);