summary refs log tree commit diff
path: root/src/test/ui/consts/too_generic_eval_ice.rs
blob: 7a299169bc4e19e59a5c0d63749140049a14fe9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
pub struct Foo<A, B>(A, B);

impl<A, B> Foo<A, B> {
    const HOST_SIZE: usize = std::mem::size_of::<B>();

    pub fn crash() -> bool {
        [5; Self::HOST_SIZE] == [6; 0] //~ ERROR no associated item named `HOST_SIZE`
        //~^ the size for values of type `A` cannot be known
        //~| the size for values of type `B` cannot be known
    }
}

fn main() {}