Skip to content

Commit 071f737

Browse files
committed
Remove some more useless ty::Binder::dummy calls
1 parent d9f842a commit 071f737

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
764764
self.tcx,
765765
self.cause.clone(),
766766
self.param_env,
767-
ty::Binder::dummy(ty::TraitRef::from_lang_item(
767+
ty::TraitRef::from_lang_item(
768768
self.tcx.at(self.cause.span),
769769
hir::LangItem::PointerLike,
770770
[a],
771-
)),
771+
),
772772
));
773773

774774
Ok(InferOk {

compiler/rustc_trait_selection/src/solve/project_goals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
334334

335335
ty::Alias(_, _) | ty::Param(_) | ty::Placeholder(..) => {
336336
// FIXME(ptr_metadata): It would also be possible to return a `Ok(Ambig)` with no constraints.
337-
let sized_predicate = ty::Binder::dummy(ty::TraitRef::from_lang_item(
337+
let sized_predicate = ty::TraitRef::from_lang_item(
338338
tcx.at(DUMMY_SP),
339339
LangItem::Sized,
340340
[ty::GenericArg::from(goal.predicate.self_ty())],
341-
));
341+
);
342342
ecx.add_goal(goal.with(tcx, sized_predicate));
343343
tcx.types.unit
344344
}

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
646646
output_ty,
647647
&mut nested,
648648
);
649-
let tr = ty::Binder::dummy(ty::TraitRef::from_lang_item(
650-
self.tcx().at(cause.span),
651-
LangItem::Sized,
652-
[output_ty],
653-
));
649+
let tr =
650+
ty::TraitRef::from_lang_item(self.tcx().at(cause.span), LangItem::Sized, [output_ty]);
654651
nested.push(Obligation::new(self.infcx.tcx, cause, obligation.param_env, tr));
655652

656653
Ok(ImplSourceFnPointerData { fn_ty: self_ty, nested })

0 commit comments

Comments
 (0)