1 // FIXME: should be run-rustfix, but rustfix doesn't currently support multipart suggestions, see
4 #![feature(or_patterns)]
17 pub fn no_ref(x: MyEnum) {
21 A { i, j } | B { i, j } => { //~ ERROR unused variable
27 pub fn with_ref(x: MyEnum) {
31 A { i, ref j } | B { i, ref j } => { //~ ERROR unused variable
37 pub fn inner_no_ref(x: Option<MyEnum>) {
41 Some(A { i, j } | B { i, j }) => { //~ ERROR unused variable
49 pub fn inner_with_ref(x: Option<MyEnum>) {
53 Some(A { i, ref j } | B { i, ref j }) => { //~ ERROR unused variable
61 pub fn mixed_no_ref(x: MixedEnum) {
63 MixedEnum::A { i } | MixedEnum::B(i) => { //~ ERROR unused variable
69 pub fn mixed_with_ref(x: MixedEnum) {
71 MixedEnum::A { ref i } | MixedEnum::B(ref i) => { //~ ERROR unused variable
78 no_ref(MyEnum::A { i: 1, j: 2 });
79 with_ref(MyEnum::A { i: 1, j: 2 });
81 inner_no_ref(Some(MyEnum::A { i: 1, j: 2 }));
82 inner_with_ref(Some(MyEnum::A { i: 1, j: 2 }));
84 mixed_no_ref(MixedEnum::B(5));
85 mixed_with_ref(MixedEnum::B(5));