https://gcc.gnu.org/g:604ab7aa6465500a827db7292aa952b9c88bdec3
commit r15-8843-g604ab7aa6465500a827db7292aa952b9c88bdec3 Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Date: Wed Mar 5 11:56:49 2025 +0100 gccrs: 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.pa...@embecosm.com> Diff: --- gcc/testsuite/rust/compile/enum_variant_name.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 000000000000..671fced2bb8c --- /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 + }, +}