summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/associated-const.rs
blob: a6777632254b71e5ce5412a3719d2e55060220ea (plain)
1
2
3
4
5
6
7
8
9
10
11
// check-pass
struct Foo<T>(T);
impl<T> Foo<T> {
    const VALUE: usize = std::mem::size_of::<T>();
}

fn test<T>() {
    let _ = [0; Foo::<u8>::VALUE];
}

fn main() {}