Remove some more useless ty::Binder::dummy calls

This commit is contained in:
Maybe Waffle 2023-04-26 10:38:54 +00:00
parent d9f842a4dc
commit 071f737a57
3 changed files with 6 additions and 9 deletions

View File

@ -764,11 +764,11 @@ fn coerce_dyn_star(
self.tcx,
self.cause.clone(),
self.param_env,
ty::Binder::dummy(ty::TraitRef::from_lang_item(
ty::TraitRef::from_lang_item(
self.tcx.at(self.cause.span),
hir::LangItem::PointerLike,
[a],
)),
),
));
Ok(InferOk {

View File

@ -334,11 +334,11 @@ fn consider_builtin_pointee_candidate(
ty::Alias(_, _) | ty::Param(_) | ty::Placeholder(..) => {
// FIXME(ptr_metadata): It would also be possible to return a `Ok(Ambig)` with no constraints.
let sized_predicate = ty::Binder::dummy(ty::TraitRef::from_lang_item(
let sized_predicate = ty::TraitRef::from_lang_item(
tcx.at(DUMMY_SP),
LangItem::Sized,
[ty::GenericArg::from(goal.predicate.self_ty())],
));
);
ecx.add_goal(goal.with(tcx, sized_predicate));
tcx.types.unit
}

View File

@ -646,11 +646,8 @@ fn confirm_fn_pointer_candidate(
output_ty,
&mut nested,
);
let tr = ty::Binder::dummy(ty::TraitRef::from_lang_item(
self.tcx().at(cause.span),
LangItem::Sized,
[output_ty],
));
let tr =
ty::TraitRef::from_lang_item(self.tcx().at(cause.span), LangItem::Sized, [output_ty]);
nested.push(Obligation::new(self.infcx.tcx, cause, obligation.param_env, tr));
Ok(ImplSourceFnPointerData { fn_ty: self_ty, nested })