diff options
| author | bors <bors@rust-lang.org> | 2022-01-03 14:30:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-03 14:30:36 +0000 |
| commit | ddabe0775c5f5b551d5eb54e3c4366fb8bec0c92 (patch) | |
| tree | 710c45c1ed562d6bc165be9a3664a2cfb6f8f20a /compiler/rustc_codegen_ssa/src | |
| parent | b5efe5727f5db54412cf2995d14def91140a5a42 (diff) | |
| parent | 13e284033e34609f5f911d3df989eddec4af3f1b (diff) | |
| download | rust-ddabe0775c5f5b551d5eb54e3c4366fb8bec0c92.tar.gz rust-ddabe0775c5f5b551d5eb54e3c4366fb8bec0c92.zip | |
Auto merge of #92518 - matthiaskrgr:rollup-fl8z4e7, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #90102 (Remove `NullOp::Box`) - #92011 (Use field span in `rustc_macros` when emitting decode call) - #92402 (Suggest while let x = y when encountering while x = y) - #92409 (Couple of libtest cleanups) - #92418 (Fix spacing in pretty printed PatKind::Struct with no fields) - #92444 (Consolidate Result's and Option's methods into fewer impl blocks) Failed merges: - #92483 (Stabilize `result_cloned` and `result_copied`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 6f960ca44cd..679c4576701 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -8,7 +8,6 @@ use crate::traits::*; use crate::MemFlags; use rustc_apfloat::{ieee, Float, Round, Status}; -use rustc_hir::lang_items::LangItem; use rustc_middle::mir; use rustc_middle::ty::cast::{CastTy, IntTy}; use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; @@ -486,31 +485,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { ) } - mir::Rvalue::NullaryOp(mir::NullOp::Box, content_ty) => { - let content_ty = self.monomorphize(content_ty); - let content_layout = bx.cx().layout_of(content_ty); - let llsize = bx.cx().const_usize(content_layout.size.bytes()); - let llalign = bx.cx().const_usize(content_layout.align.abi.bytes()); - let box_layout = bx.cx().layout_of(bx.tcx().mk_box(content_ty)); - let llty_ptr = bx.cx().backend_type(box_layout); - - // Allocate space: - let def_id = match bx.tcx().lang_items().require(LangItem::ExchangeMalloc) { - Ok(id) => id, - Err(s) => { - bx.cx().sess().fatal(&format!("allocation of `{}` {}", box_layout.ty, s)); - } - }; - let instance = ty::Instance::mono(bx.tcx(), def_id); - let r = bx.cx().get_fn_addr(instance); - let ty = bx.type_func(&[bx.type_isize(), bx.type_isize()], bx.type_i8p()); - let call = bx.call(ty, r, &[llsize, llalign], None); - let val = bx.pointercast(call, llty_ptr); - - let operand = OperandRef { val: OperandValue::Immediate(val), layout: box_layout }; - (bx, operand) - } - mir::Rvalue::NullaryOp(null_op, ty) => { let ty = self.monomorphize(ty); assert!(bx.cx().type_is_sized(ty)); @@ -518,7 +492,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let val = match null_op { mir::NullOp::SizeOf => layout.size.bytes(), mir::NullOp::AlignOf => layout.align.abi.bytes(), - mir::NullOp::Box => unreachable!(), }; let val = bx.cx().const_usize(val); let tcx = self.cx.tcx(); |
