diff --git a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs index d106bf713412..5e6a97b3ff7d 100644 --- a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs +++ b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs @@ -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` } } diff --git a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr index cadf5e6cdeea..abb8d6907e76 100644 --- a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr +++ b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr @@ -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`