3 // Regression test for the issue #63151:
4 // Spurious unused field warning when matching variants under a `Self` scope
6 // This test checks that the `dead_code` lint properly inspects fields
7 // in struct patterns that use a type relative path.
12 Variant { field: usize }
16 fn read_field(self) -> usize {
18 Self::Variant { field } => field
24 let e = Enum::Variant { field: 42 };
25 println!("{}", e.read_field());