diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-11-07 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-11-07 00:00:00 +0000 |
| commit | f78f36cdb79db07ae2b650426fd42c94a2f29ae9 (patch) | |
| tree | dadf1f2166ae10d8312c32b4a8e2649b93da8395 /compiler/rustc_codegen_ssa/src | |
| parent | 0256d065d4901b63def6c04013da4f781d0752bb (diff) | |
| download | rust-f78f36cdb79db07ae2b650426fd42c94a2f29ae9.tar.gz rust-f78f36cdb79db07ae2b650426fd42c94a2f29ae9.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 7ce110dcbfc..40ae0a13c72 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -502,6 +502,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { } 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(); |
