rust/src/test/ui/const_evaluatable/associated-const.rs
Bastian Kauschke 7804644863 add tests
2020-09-08 16:39:12 +02:00

12 lines
169 B
Rust

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