aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/generics8.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/rust.test/xfail_compile/generics8.rs b/gcc/testsuite/rust.test/xfail_compile/generics8.rs
new file mode 100644
index 0000000..70bad1a
--- /dev/null
+++ b/gcc/testsuite/rust.test/xfail_compile/generics8.rs
@@ -0,0 +1,15 @@
+struct Foo<A, B>(A, B);
+
+impl<T> Foo<i32, T> {
+ fn test(a: T) -> T { // { dg-error "duplicate definitions with name test" }
+ a
+ }
+}
+
+impl Foo<i32, f32> {
+ fn test() -> f32 { // { dg-error "duplicate definitions with name test" }
+ 123f32
+ }
+}
+
+fn main() {}