1 #![allow(unused_variables)]
2 #![allow(non_camel_case_types)]
7 b: bool, //~ ERROR: field `b` is never read
10 fn field_read(f: Foo) -> usize {
15 X, //~ ERROR variants `X` and `Y` are never constructed
24 enum ABC { //~ ERROR enum `ABC` is never used
34 // ensure struct variants get warning for their fields
36 I, //~ ERROR variants `I` and `K` are never constructed
39 b: i32, //~ ERROR fields `b` and `c` are never read
46 fn struct_variant_partial_use(b: IJK) -> String {
48 IJK::J { a, b: _, .. } => a,
53 fn field_match_in_patterns(b: XYZ) -> String {
55 XYZ::Y { a, b: _, .. } => a,
61 x: usize, //~ ERROR: fields `x` and `c` are never read
72 fn field_match_in_let(f: Bar) -> bool {
73 let Bar { b, c: _, .. } = f;
78 field_read(Foo { x: 1, b: false });
79 field_match_in_patterns(XYZ::Z);
80 struct_variant_partial_use(IJK::J { a: "".into(), b: 1, c: -1 });
81 field_match_in_let(Bar { x: 42, b: true, c: false, _guard: () });