diff options
Diffstat (limited to 'tests/ui/consts/const-eval/issue-64908.rs')
-rw-r--r-- | tests/ui/consts/const-eval/issue-64908.rs | 20 |
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 000000000..d2e095072 --- /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::<()>(); +} |