mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Monomorphize a type argument of size-of operation during codegen
This wasn't necessary until MIR inliner started to consider drop glue as a candidate for inlining; introducing for the first time a generic use of size-of operation. No test at this point since this only happens with a custom inlining threshold.
This commit is contained in:
@@ -502,6 +502,7 @@ pub fn codegen_rvalue_operand(
|
||||
}
|
||||
|
||||
mir::Rvalue::NullaryOp(mir::NullOp::SizeOf, ty) => {
|
||||
let ty = self.monomorphize(&ty);
|
||||
assert!(bx.cx().type_is_sized(ty));
|
||||
let val = bx.cx().const_usize(bx.cx().layout_of(ty).size.bytes());
|
||||
let tcx = self.cx.tcx();
|
||||
|
||||
Reference in New Issue
Block a user