Make P parameter explicit
This commit is contained in:
parent
11ec3eca74
commit
412dc28d6a
14 changed files with 62 additions and 49 deletions
|
@ -337,7 +337,10 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
|
|||
self.obligations.extend(obligations);
|
||||
}
|
||||
|
||||
pub fn register_predicates(&mut self, obligations: impl IntoIterator<Item: Upcast<'tcx>>) {
|
||||
pub fn register_predicates(
|
||||
&mut self,
|
||||
obligations: impl IntoIterator<Item: Upcast<'tcx, ty::Predicate<'tcx>>>,
|
||||
) {
|
||||
self.obligations.extend(obligations.into_iter().map(|to_pred| {
|
||||
Obligation::new(self.infcx.tcx, self.trace.cause.clone(), self.param_env, to_pred)
|
||||
}))
|
||||
|
@ -360,7 +363,10 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
|
|||
/// Register predicates that must hold in order for this relation to hold. Uses
|
||||
/// a default obligation cause, [`ObligationEmittingRelation::register_obligations`] should
|
||||
/// be used if control over the obligation causes is required.
|
||||
fn register_predicates(&mut self, obligations: impl IntoIterator<Item: Upcast<'tcx>>);
|
||||
fn register_predicates(
|
||||
&mut self,
|
||||
obligations: impl IntoIterator<Item: Upcast<'tcx, ty::Predicate<'tcx>>>,
|
||||
);
|
||||
|
||||
/// Register `AliasRelate` obligation(s) that both types must be related to each other.
|
||||
fn register_type_relate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>);
|
||||
|
|
|
@ -140,7 +140,10 @@ impl<'tcx> ObligationEmittingRelation<'tcx> for Glb<'_, '_, 'tcx> {
|
|||
self.fields.param_env
|
||||
}
|
||||
|
||||
fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::Upcast<'tcx>>) {
|
||||
fn register_predicates(
|
||||
&mut self,
|
||||
obligations: impl IntoIterator<Item: ty::Upcast<'tcx, ty::Predicate<'tcx>>>,
|
||||
) {
|
||||
self.fields.register_predicates(obligations);
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,10 @@ impl<'tcx> ObligationEmittingRelation<'tcx> for Lub<'_, '_, 'tcx> {
|
|||
self.fields.param_env
|
||||
}
|
||||
|
||||
fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::Upcast<'tcx>>) {
|
||||
fn register_predicates(
|
||||
&mut self,
|
||||
obligations: impl IntoIterator<Item: ty::Upcast<'tcx, ty::Predicate<'tcx>>>,
|
||||
) {
|
||||
self.fields.register_predicates(obligations);
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,10 @@ impl<'tcx> ObligationEmittingRelation<'tcx> for TypeRelating<'_, '_, 'tcx> {
|
|||
self.structurally_relate_aliases
|
||||
}
|
||||
|
||||
fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::Upcast<'tcx>>) {
|
||||
fn register_predicates(
|
||||
&mut self,
|
||||
obligations: impl IntoIterator<Item: ty::Upcast<'tcx, ty::Predicate<'tcx>>>,
|
||||
) {
|
||||
self.fields.register_predicates(obligations);
|
||||
}
|
||||
|
||||
|
|
|
@ -357,9 +357,7 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
|
|||
None
|
||||
}
|
||||
})
|
||||
.map(|clause| {
|
||||
elaboratable.child(bound_clause.rebind(clause).upcast(tcx))
|
||||
}),
|
||||
.map(|clause| elaboratable.child(bound_clause.rebind(clause).upcast(tcx))),
|
||||
);
|
||||
}
|
||||
ty::ClauseKind::RegionOutlives(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue