diff options
| author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-03-05 11:56:49 +0100 |
|---|---|---|
| committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2025-03-11 14:06:30 +0000 |
| commit | d6c5c64449ac4c37d529d41686da2e0dfc186435 (patch) | |
| tree | 72e605d4711d9fc924b3437dcb588455edcd1c30 | |
| parent | 30c9879f775664d5344629ffbd2571fb02cb077f (diff) | |
| download | gcc-d6c5c64449ac4c37d529d41686da2e0dfc186435.zip gcc-d6c5c64449ac4c37d529d41686da2e0dfc186435.tar.gz gcc-d6c5c64449ac4c37d529d41686da2e0dfc186435.tar.bz2 | |
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 <pierre-emmanuel.patry@embecosm.com>
| -rw-r--r-- | gcc/testsuite/rust/compile/enum_variant_name.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/enum_variant_name.rs b/gcc/testsuite/rust/compile/enum_variant_name.rs new file mode 100644 index 0000000..671fced --- /dev/null +++ b/gcc/testsuite/rust/compile/enum_variant_name.rs @@ -0,0 +1,12 @@ +// { dg-additional-options "-w -frust-name-resolution-2.0" } +struct E1; + +enum Test { + E1 = { + let x = E1; + { + let x = E1; + } + 0 + }, +} |
