1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
struct Bar<T>(T); trait Baz { fn hey(); } impl Baz for u16 { fn hey() { let _: [u8; std::mem::size_of::<Self>()]; // ok } } impl<T> Baz for Bar<T> { fn hey() { let _: [u8; std::mem::size_of::<Self>()]; //~ERROR generic `Self` } } fn main() {}