Simplify a bunch of trait ref obligation creations
This commit is contained in:
parent
08afabddac
commit
42cc8e8f4e
10 changed files with 17 additions and 40 deletions
|
@ -131,7 +131,7 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
|
|||
tcx,
|
||||
cause.clone(),
|
||||
self.param_env,
|
||||
ty::Binder::dummy(trait_ref).without_const(),
|
||||
ty::Binder::dummy(trait_ref),
|
||||
);
|
||||
if !self.infcx.predicate_may_hold(&obligation) {
|
||||
debug!("overloaded_deref_ty: cannot match obligation");
|
||||
|
|
|
@ -723,8 +723,7 @@ fn receiver_is_dispatchable<'tcx>(
|
|||
let obligation = {
|
||||
let predicate = ty::Binder::dummy(
|
||||
tcx.mk_trait_ref(dispatch_from_dyn_did, [receiver_ty, unsized_receiver_ty]),
|
||||
)
|
||||
.without_const();
|
||||
);
|
||||
|
||||
Obligation::new(tcx, ObligationCause::dummy(), param_env, predicate)
|
||||
};
|
||||
|
|
|
@ -731,12 +731,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// <ty as Deref>
|
||||
let trait_ref = tcx.mk_trait_ref(tcx.lang_items().deref_trait()?, [ty]);
|
||||
|
||||
let obligation = traits::Obligation::new(
|
||||
tcx,
|
||||
cause.clone(),
|
||||
param_env,
|
||||
ty::Binder::dummy(trait_ref).without_const(),
|
||||
);
|
||||
let obligation =
|
||||
traits::Obligation::new(tcx, cause.clone(), param_env, ty::Binder::dummy(trait_ref));
|
||||
if !self.infcx.predicate_may_hold(&obligation) {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue