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() {}