aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/traits2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/traits2.rs')
-rw-r--r--gcc/testsuite/rust/compile/traits2.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/traits2.rs b/gcc/testsuite/rust/compile/traits2.rs
new file mode 100644
index 0000000..7357c22
--- /dev/null
+++ b/gcc/testsuite/rust/compile/traits2.rs
@@ -0,0 +1,14 @@
+trait Foo {
+ fn Bar() -> i32 {}
+ // { dg-error "expected .i32. got .()." "" { target *-*-* } .-1 }
+}
+
+struct Baz;
+
+impl Foo for Baz {
+ fn Bar() {}
+ // { dg-error "expected .i32. got .()." "" { target *-*-* } .-1 }
+ // { dg-error "method .Bar. has an incompatible type for trait .Foo." "" { target *-*-* } .-2 }
+}
+
+fn main() {}