Replace run-rustfix for issue 67691 test with a FIXME

This commit is contained in:
sapir 2020-04-10 03:32:49 +03:00
parent a8e3d0b71e
commit 32216383fa
3 changed files with 9 additions and 93 deletions

View file

@ -1,85 +0,0 @@
// run-rustfix
#![feature(or_patterns)]
#![deny(unused)]
pub enum MyEnum {
A { i: i32, j: i32 },
B { i: i32, j: i32 },
}
pub enum MixedEnum {
A { i: i32 },
B(i32),
}
pub fn no_ref(x: MyEnum) {
use MyEnum::*;
match x {
A { i, j: _ } | B { i, j: _ } => { //~ ERROR unused variable
println!("{}", i);
}
}
}
pub fn with_ref(x: MyEnum) {
use MyEnum::*;
match x {
A { i, j: _ } | B { i, j: _ } => { //~ ERROR unused variable
println!("{}", i);
}
}
}
pub fn inner_no_ref(x: Option<MyEnum>) {
use MyEnum::*;
match x {
Some(A { i, j: _ } | B { i, j: _ }) => { //~ ERROR unused variable
println!("{}", i);
}
_ => {}
}
}
pub fn inner_with_ref(x: Option<MyEnum>) {
use MyEnum::*;
match x {
Some(A { i, j: _ } | B { i, j: _ }) => { //~ ERROR unused variable
println!("{}", i);
}
_ => {}
}
}
pub fn mixed_no_ref(x: MixedEnum) {
match x {
MixedEnum::A { i: _ } | MixedEnum::B(_) => {
println!("match");
}
}
}
pub fn mixed_with_ref(x: MixedEnum) {
match x {
MixedEnum::A { i: _ } | MixedEnum::B(_) => {
println!("match");
}
}
}
pub fn main() {
no_ref(MyEnum::A { i: 1, j: 2 });
with_ref(MyEnum::A { i: 1, j: 2 });
inner_no_ref(Some(MyEnum::A { i: 1, j: 2 }));
inner_with_ref(Some(MyEnum::A { i: 1, j: 2 }));
mixed_no_ref(MixedEnum::B(5));
mixed_with_ref(MixedEnum::B(5));
}

View file

@ -1,4 +1,5 @@
// run-rustfix
// FIXME: should be run-rustfix, but rustfix doesn't currently support multipart suggestions, see
// #53934
#![feature(or_patterns)]
#![deny(unused)]

View file

@ -1,11 +1,11 @@
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:20:16
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:21:16
|
LL | A { i, j } | B { i, j } => {
| ^ ^
|
note: the lint level is defined here
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:4:9
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:5:9
|
LL | #![deny(unused)]
| ^^^^^^
@ -16,7 +16,7 @@ LL | A { i, j: _ } | B { i, j: _ } => {
| ^^^^ ^^^^
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:31:16
|
LL | A { i, ref j } | B { i, ref j } => {
| ^^^^^ ^^^^^
@ -27,7 +27,7 @@ LL | A { i, j: _ } | B { i, j: _ } => {
| ^^^^ ^^^^
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:40:21
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:41:21
|
LL | Some(A { i, j } | B { i, j }) => {
| ^ ^
@ -38,7 +38,7 @@ LL | Some(A { i, j: _ } | B { i, j: _ }) => {
| ^^^^ ^^^^
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:53:21
|
LL | Some(A { i, ref j } | B { i, ref j }) => {
| ^^^^^ ^^^^^
@ -49,7 +49,7 @@ LL | Some(A { i, j: _ } | B { i, j: _ }) => {
| ^^^^ ^^^^
error: unused variable: `i`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:62:24
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:63:24
|
LL | MixedEnum::A { i } | MixedEnum::B(i) => {
| ^ ^
@ -60,7 +60,7 @@ LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
| ^^^^ ^
error: unused variable: `i`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:70:24
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:71:24
|
LL | MixedEnum::A { ref i } | MixedEnum::B(ref i) => {
| ^^^^^ ^^^^^