summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/issue-64908.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-eval/issue-64908.rs')
-rw-r--r--src/test/ui/consts/const-eval/issue-64908.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-eval/issue-64908.rs b/src/test/ui/consts/const-eval/issue-64908.rs
new file mode 100644
index 000000000..d2e095072
--- /dev/null
+++ b/src/test/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::<()>();
+}