From: Pierre-Emmanuel Patry <[email protected]>
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]>
---
gcc/testsuite/rust/compile/enum_variant_name.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/enum_variant_name.rs
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
+ },
+}
--
2.45.2