Skip to content

Commit f78f36c

Browse files
committed
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.
1 parent 0256d06 commit f78f36c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
502502
}
503503

504504
mir::Rvalue::NullaryOp(mir::NullOp::SizeOf, ty) => {
505+
let ty = self.monomorphize(&ty);
505506
assert!(bx.cx().type_is_sized(ty));
506507
let val = bx.cx().const_usize(bx.cx().layout_of(ty).size.bytes());
507508
let tcx = self.cx.tcx();

0 commit comments

Comments
 (0)