Simplify a bunch of trait ref obligation creations
This commit is contained in:
committed by
Santiago Pastorino
parent
08afabddac
commit
42cc8e8f4e
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user