about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/issue-64908.rs
blob: 5d5fdab790e92a6734a75dbb00e63fcdd51eca85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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::<()>();
}