about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/issue-64908.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/issue-64908.rs')
-rw-r--r--tests/ui/consts/const-eval/issue-64908.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/issue-64908.rs b/tests/ui/consts/const-eval/issue-64908.rs
new file mode 100644
index 00000000000..d2e09507284
--- /dev/null
+++ b/tests/ui/consts/const-eval/issue-64908.rs
@@ -0,0 +1,20 @@
+// run-pass
+
+// This test verifies that the `ConstProp` pass doesn't cause an ICE when evaluating polymorphic
+// promoted MIR.
+
+pub trait ArrowPrimitiveType {
+    type Native;
+}
+
+pub fn new<T: ArrowPrimitiveType>() {
+    assert_eq!(0, std::mem::size_of::<T::Native>());
+}
+
+impl ArrowPrimitiveType for () {
+    type Native = ();
+}
+
+fn main() {
+    new::<()>();
+}