about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-01-07 10:01:52 -0500
committerAaron Hill <aa1ronham@gmail.com>2020-01-13 05:00:55 -0500
commite1fc22c4eba6e07a5549c74b197fbaa53f7b29e1 (patch)
tree24fd948d23dc7e5b42a1a66b675f4848ec564d6a
parent5896998e7659bf22ffb804956a3680c028ede45f (diff)
Add additional regression test
-rw-r--r--src/test/ui/consts/issue-67696-const-prop-ice.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-67696-const-prop-ice.rs b/src/test/ui/consts/issue-67696-const-prop-ice.rs
new file mode 100644
index 00000000000..ad52608b3f4
--- /dev/null
+++ b/src/test/ui/consts/issue-67696-const-prop-ice.rs
@@ -0,0 +1,20 @@
+// check-pass
+// compile-flags: --emit=mir,link
+// Checks that we don't ICE due to attempting to run const prop
+// on a function with unsatisifable 'where' clauses
+
+#![allow(unused)]
+
+trait A {
+    fn foo(&self) -> Self where Self: Copy;
+}
+
+impl A for [fn(&())] {
+    fn foo(&self) -> Self where Self: Copy { *(&[] as &[_]) }
+}
+
+impl A for i32 {
+    fn foo(&self) -> Self { 3 }
+}
+
+fn main() {}