diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /compiler/rustc_mir_dataflow/src/elaborate_drops.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/elaborate_drops.rs')
-rw-r--r-- | compiler/rustc_mir_dataflow/src/elaborate_drops.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index ce87a1916..7836ae2e7 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -596,7 +596,6 @@ where source_info: self.source_info, kind: TerminatorKind::SwitchInt { discr: Operand::Move(discr), - switch_ty: discr_ty, targets: SwitchTargets::new( values.iter().copied().zip(blocks.iter().copied()), *blocks.last().unwrap(), @@ -615,7 +614,6 @@ where let drop_trait = tcx.require_lang_item(LangItem::Drop, None); let drop_fn = tcx.associated_item_def_ids(drop_trait)[0]; let ty = self.place_ty(self.place); - let substs = tcx.mk_substs_trait(ty, []); let ref_ty = tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut { ty, mutbl: hir::Mutability::Mut }); @@ -633,7 +631,12 @@ where )], terminator: Some(Terminator { kind: TerminatorKind::Call { - func: Operand::function_handle(tcx, drop_fn, substs, self.source_info.span), + func: Operand::function_handle( + tcx, + drop_fn, + [ty.into()], + self.source_info.span, + ), args: vec![Operand::Move(Place::from(ref_place))], destination: unit_temp, target: Some(succ), @@ -716,7 +719,7 @@ where is_cleanup: unwind.is_cleanup(), terminator: Some(Terminator { source_info: self.source_info, - kind: TerminatorKind::if_(tcx, move_(can_go), succ, drop_block), + kind: TerminatorKind::if_(move_(can_go), succ, drop_block), }), }; let loop_block = self.elaborator.patch().new_block(loop_block); @@ -781,7 +784,6 @@ where source_info: self.source_info, kind: TerminatorKind::SwitchInt { discr: move_(elem_size), - switch_ty: tcx.types.usize, targets: SwitchTargets::static_if( 0, self.drop_loop_pair(ety, false, len), @@ -1021,7 +1023,7 @@ where DropStyle::Static => on_set, DropStyle::Conditional | DropStyle::Open => { let flag = self.elaborator.get_drop_flag(self.path).unwrap(); - let term = TerminatorKind::if_(self.tcx(), flag, on_set, on_unset); + let term = TerminatorKind::if_(flag, on_set, on_unset); self.new_block(unwind, term) } } |