[gcc/devel/rust/master] Add a test for enum variant name resolution
Thomas Schwinge
tschwinge@gcc.gnu.org
Wed Mar 26 14:17:20 GMT 2025
https://gcc.gnu.org/g:d6c5c64449ac4c37d529d41686da2e0dfc186435
commit d6c5c64449ac4c37d529d41686da2e0dfc186435
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Mar 5 11:56:49 2025 +0100
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>
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
+ },
+}
More information about the Gcc-cvs
mailing list