aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/traits4.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/traits4.rs')
-rw-r--r--gcc/testsuite/rust/compile/traits4.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/traits4.rs b/gcc/testsuite/rust/compile/traits4.rs
new file mode 100644
index 0000000..486301d
--- /dev/null
+++ b/gcc/testsuite/rust/compile/traits4.rs
@@ -0,0 +1,16 @@
+trait Foo {
+ const A: i32;
+
+ fn test(self);
+}
+
+struct Bar;
+impl Foo for Bar {
+ // { dg-error "missing A in implementation of trait .Foo." "" { target *-*-* } .-1 }
+ fn test(self) {}
+}
+
+fn main() {
+ let a = Bar;
+ a.test();
+}