summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/const_equate_assoc_consts.rs
blob: e8f89cb1aa2ca0b350115161ac48746b1f337852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// check-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

trait Trait {
    const ASSOC: usize;
}
impl<T> Trait for T {
    const ASSOC: usize = std::mem::size_of::<T>();
}

struct Foo<T: Trait>([u8; T::ASSOC])
where
    [(); T::ASSOC]:;

fn bar<T: Trait>()
where
    [(); T::ASSOC]:,
{
    let _: Foo<T> = Foo::<_>(make());
}

fn make() -> ! {
    todo!()
}

fn main() {}