aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3552.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-3552.rs')
-rw-r--r--gcc/testsuite/rust/compile/issue-3552.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-3552.rs b/gcc/testsuite/rust/compile/issue-3552.rs
new file mode 100644
index 0000000..9a4451b14b
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-3552.rs
@@ -0,0 +1,14 @@
+trait Foo {
+ const BAR: u32;
+}
+
+const TRAIT_REF_BAR: u32 = <Foo>::BAR;
+// { dg-error "no default expression on trait constant" "" { target *-*-* } .-1 }
+
+struct GlobalTraitRef;
+
+impl Foo for GlobalTraitRef {
+ const BAR: u32 = TRAIT_REF_BAR;
+}
+
+fn main() {}