Remove one more usage of mk_substs_trait
This commit is contained in:
parent
1bf80249ae
commit
4ffe3bdf99
3 changed files with 8 additions and 4 deletions
|
@ -1847,7 +1847,7 @@ impl<'tcx> Operand<'tcx> {
|
||||||
pub fn function_handle(
|
pub fn function_handle(
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
substs: SubstsRef<'tcx>,
|
substs: impl IntoIterator<Item = GenericArg<'tcx>>,
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let ty = tcx.mk_fn_def(def_id, substs);
|
let ty = tcx.mk_fn_def(def_id, substs);
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
let exchange_malloc = Operand::function_handle(
|
let exchange_malloc = Operand::function_handle(
|
||||||
tcx,
|
tcx,
|
||||||
tcx.require_lang_item(LangItem::ExchangeMalloc, Some(expr_span)),
|
tcx.require_lang_item(LangItem::ExchangeMalloc, Some(expr_span)),
|
||||||
ty::List::empty(),
|
[],
|
||||||
expr_span,
|
expr_span,
|
||||||
);
|
);
|
||||||
let storage = this.temp(tcx.mk_mut_ptr(tcx.types.u8), expr_span);
|
let storage = this.temp(tcx.mk_mut_ptr(tcx.types.u8), expr_span);
|
||||||
|
|
|
@ -614,7 +614,6 @@ where
|
||||||
let drop_trait = tcx.require_lang_item(LangItem::Drop, None);
|
let drop_trait = tcx.require_lang_item(LangItem::Drop, None);
|
||||||
let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
|
let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
|
||||||
let ty = self.place_ty(self.place);
|
let ty = self.place_ty(self.place);
|
||||||
let substs = tcx.mk_substs_trait(ty, []);
|
|
||||||
|
|
||||||
let ref_ty =
|
let ref_ty =
|
||||||
tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut { ty, mutbl: hir::Mutability::Mut });
|
tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut { ty, mutbl: hir::Mutability::Mut });
|
||||||
|
@ -632,7 +631,12 @@ where
|
||||||
)],
|
)],
|
||||||
terminator: Some(Terminator {
|
terminator: Some(Terminator {
|
||||||
kind: TerminatorKind::Call {
|
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))],
|
args: vec![Operand::Move(Place::from(ref_place))],
|
||||||
destination: unit_temp,
|
destination: unit_temp,
|
||||||
target: Some(succ),
|
target: Some(succ),
|
||||||
|
|
Loading…
Add table
Reference in a new issue