Skip to content

Commit 4ffe3bd

Browse files
committed
Remove one more usage of mk_substs_trait
1 parent 1bf8024 commit 4ffe3bd

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ impl<'tcx> Operand<'tcx> {
18471847
pub fn function_handle(
18481848
tcx: TyCtxt<'tcx>,
18491849
def_id: DefId,
1850-
substs: SubstsRef<'tcx>,
1850+
substs: impl IntoIterator<Item = GenericArg<'tcx>>,
18511851
span: Span,
18521852
) -> Self {
18531853
let ty = tcx.mk_fn_def(def_id, substs);

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
142142
let exchange_malloc = Operand::function_handle(
143143
tcx,
144144
tcx.require_lang_item(LangItem::ExchangeMalloc, Some(expr_span)),
145-
ty::List::empty(),
145+
[],
146146
expr_span,
147147
);
148148
let storage = this.temp(tcx.mk_mut_ptr(tcx.types.u8), expr_span);

compiler/rustc_mir_dataflow/src/elaborate_drops.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,6 @@ where
614614
let drop_trait = tcx.require_lang_item(LangItem::Drop, None);
615615
let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
616616
let ty = self.place_ty(self.place);
617-
let substs = tcx.mk_substs_trait(ty, []);
618617

619618
let ref_ty =
620619
tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut { ty, mutbl: hir::Mutability::Mut });
@@ -632,7 +631,12 @@ where
632631
)],
633632
terminator: Some(Terminator {
634633
kind: TerminatorKind::Call {
635-
func: Operand::function_handle(tcx, drop_fn, substs, self.source_info.span),
634+
func: Operand::function_handle(
635+
tcx,
636+
drop_fn,
637+
[ty.into()],
638+
self.source_info.span,
639+
),
636640
args: vec![Operand::Move(Place::from(ref_place))],
637641
destination: unit_temp,
638642
target: Some(succ),

0 commit comments

Comments
 (0)