Skip to content

Commit d6c5c64

Browse files
committed
Add a test for enum variant name resolution
Highlight the fact that a value inside an enum definition refers to a struct outside of the enum and not to the enum variant's name directly. gcc/testsuite/ChangeLog: * rust/compile/enum_variant_name.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent 30c9879 commit d6c5c64

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// { dg-additional-options "-w -frust-name-resolution-2.0" }
2+
struct E1;
3+
4+
enum Test {
5+
E1 = {
6+
let x = E1;
7+
{
8+
let x = E1;
9+
}
10+
0
11+
},
12+
}

0 commit comments

Comments
 (0)