From: Pierre-Emmanuel Patry Date: Wed, 5 Mar 2025 10:56:49 +0000 (+0100) Subject: gccrs: Add a test for enum variant name resolution X-Git-Tag: basepoints/gcc-16~710 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=604ab7aa6465500a827db7292aa952b9c88bdec3;p=thirdparty%2Fgcc.git 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 --- 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 00000000000..671fced2bb8 --- /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 + }, +}