1 #![allow(unused_variables)]
2 #![allow(non_camel_case_types)]
7 b: bool, //~ ERROR: field is never used
10 fn field_read(f: Foo) -> usize {
15 X, //~ ERROR variant is never constructed
16 Y { //~ ERROR variant is never constructed
24 enum ABC { //~ ERROR enum is never used
34 // ensure struct variants get warning for their fields
36 I, //~ ERROR variant is never constructed
39 b: i32, //~ ERROR field is never used
40 c: i32, //~ ERROR field is never used
42 K //~ ERROR variant is never constructed
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: field is never used
63 c: bool, //~ ERROR: field is never used
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: () });