Add a test for regular wildcard

fix
This commit is contained in:
koka 2022-12-11 12:20:46 +09:00
parent 055f349670
commit ebb0759bb3
No known key found for this signature in database
GPG key ID: A5917A40697774CD
3 changed files with 19 additions and 1 deletions

View file

@ -146,5 +146,11 @@ mod issue9993 {
Foo::A(false) => 2,
Foo::B => 3,
};
let _ = match Foo::B {
_ if false => 0,
Foo::A(_) => 1,
Foo::B => 2,
};
}
}

View file

@ -146,5 +146,11 @@ mod issue9993 {
Foo::A(false) => 2,
Foo::B => 3,
};
let _ = match Foo::B {
_ if false => 0,
Foo::A(_) => 1,
_ => 2,
};
}
}

View file

@ -48,5 +48,11 @@ error: wildcard matches only a single variant and will also match any future add
LL | _ => (),
| ^ help: try this: `Color::Blue`
error: aborting due to 8 previous errors
error: wildcard matches only a single variant and will also match any future added variants
--> $DIR/match_wildcard_for_single_variants.rs:153:13
|
LL | _ => 2,
| ^ help: try this: `Foo::B`
error: aborting due to 9 previous errors