Closed
Description
STR
use std::mem;
trait Mirror { type Image; }
impl<T> Mirror for T { type Image = T; }
struct S1<T>(<T as Mirror>::Image);
struct S2<T>(T);
fn main() {
println!("with: {}", mem::size_of::<Option<S1<&u8>>>());
println!("without: {}", mem::size_of::<Option<S2<&u8>>>());
}
Expected Result
Nullable field optimization should be triggered in both cases
Result
with: 8
without: 16
Metadata
Metadata
Assignees
Labels
No labels