//@ compile-flags: -O //@ run-pass // Regression test for https://github.com/rust-lang/rust/issues/118328 #![allow(unused_assignments)] struct SizeOfConst(std::marker::PhantomData); impl SizeOfConst { const SIZE: usize = std::mem::size_of::(); } fn size_of() -> usize { let mut a = 0; a = SizeOfConst::::SIZE; a } fn main() { assert_eq!(size_of::(), std::mem::size_of::()); }