提交 dc19b484 编写于 作者: L LeSeulArtichaut

Enhance test

Co-authored-by: NCentril <twingoow@gmail.com>
上级 31828051
......@@ -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`
}
}
......
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`
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册