summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-11677.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/issues/issue-11677.rs')
-rw-r--r--src/test/ui/issues/issue-11677.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-11677.rs b/src/test/ui/issues/issue-11677.rs
new file mode 100644
index 000000000..be18c736f
--- /dev/null
+++ b/src/test/ui/issues/issue-11677.rs
@@ -0,0 +1,23 @@
+// run-pass
+#![allow(unused_imports)]
+
+#![allow(dead_code)]
+
+// this code used to cause an ICE
+
+use std::marker;
+
+trait X<T> {
+ fn dummy(&self) -> T { panic!() }
+}
+
+struct S<T> {f: Box<dyn X<T>+'static>,
+ g: Box<dyn X<T>+'static>}
+
+struct F;
+impl X<isize> for F {
+}
+
+fn main() {
+ S {f: Box::new(F), g: Box::new(F) };
+}