1
Fork 0

Enhance test

Co-authored-by: Centril <twingoow@gmail.com>
This commit is contained in:
LeSeulArtichaut 2020-01-02 21:08:25 +01:00
parent 318280519d
commit dc19b4842a
2 changed files with 35 additions and 14 deletions

View file

@ -12,20 +12,29 @@ enum Foo {
}
fn fn2(e: Foo) {
fn fn1(e: Foo) {
match e {
Bar => println!("A"),
Bar => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
Baz => println!("B"),
Baz => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
}
}
fn fn1(e: &Foo) {
fn fn2(e: &Foo) {
match e {
Bar => println!("A"),
Bar => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
Baz => println!("B"),
Baz => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
}
}
fn fn3(e: &mut &&mut Foo) {
match e {
Bar => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
Baz => {},
//~^ WARNING named the same as one of the variants of the type `Foo`
}
}

View file

@ -1,24 +1,36 @@
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
--> $DIR/match-same-name-enum-variant.rs:14:9
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:17:9
|
LL | Bar => println!("A"),
LL | Bar => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
--> $DIR/match-same-name-enum-variant.rs:16:9
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:19:9
|
LL | Baz => println!("B"),
LL | Baz => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
--> $DIR/match-same-name-enum-variant.rs:23:9
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:26:9
|
LL | Bar => println!("A"),
LL | Bar => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
--> $DIR/match-same-name-enum-variant.rs:25:9
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:28:9
|
LL | Baz => println!("B"),
LL | Baz => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:35:9
|
LL | Bar => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:37:9
|
LL | Baz => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz`