aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2905-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-2905-1.rs')
-rw-r--r--gcc/testsuite/rust/compile/issue-2905-1.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-2905-1.rs b/gcc/testsuite/rust/compile/issue-2905-1.rs
new file mode 100644
index 0000000..9b0c19d
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-2905-1.rs
@@ -0,0 +1,27 @@
+#![feature(lang_items)]
+
+#[lang = "sized"]
+trait Sized {}
+
+pub struct A<T>(T);
+
+pub trait B {
+ type C;
+}
+
+// ------
+// swap these two items
+
+impl B for i32 {
+ type C = Weird<i32>;
+}
+
+pub struct Weird<T>(A<(T,)>);
+
+// ------
+
+trait Foo {}
+
+impl Foo for Weird<i32> {}
+
+fn main() {}