diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-15 10:08:35 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-16 14:23:47 -0400 |
| commit | 412dc28d6a15cfc3c70f264a384cae5d598aba2e (patch) | |
| tree | 8dbf21f08fd9c534e09ab81695eed9a4cd4868a2 /compiler/rustc_infer | |
| parent | 11ec3eca740d128eee15c40f930c4d13d72be7dd (diff) | |
| download | rust-412dc28d6a15cfc3c70f264a384cae5d598aba2e.tar.gz rust-412dc28d6a15cfc3c70f264a384cae5d598aba2e.zip | |
Make P parameter explicit
Diffstat (limited to 'compiler/rustc_infer')
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/combine.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/glb.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/lub.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/type_relating.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/traits/util.rs | 4 |
5 files changed, 21 insertions, 8 deletions
diff --git a/compiler/rustc_infer/src/infer/relate/combine.rs b/compiler/rustc_infer/src/infer/relate/combine.rs index 18727335006..269607bfa7f 100644 --- a/compiler/rustc_infer/src/infer/relate/combine.rs +++ b/compiler/rustc_infer/src/infer/relate/combine.rs @@ -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>); diff --git a/compiler/rustc_infer/src/infer/relate/glb.rs b/compiler/rustc_infer/src/infer/relate/glb.rs index 1a8f02fc5ca..03573f665a2 100644 --- a/compiler/rustc_infer/src/infer/relate/glb.rs +++ b/compiler/rustc_infer/src/infer/relate/glb.rs @@ -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); } diff --git a/compiler/rustc_infer/src/infer/relate/lub.rs b/compiler/rustc_infer/src/infer/relate/lub.rs index 18f92ca5236..72570217bc9 100644 --- a/compiler/rustc_infer/src/infer/relate/lub.rs +++ b/compiler/rustc_infer/src/infer/relate/lub.rs @@ -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); } diff --git a/compiler/rustc_infer/src/infer/relate/type_relating.rs b/compiler/rustc_infer/src/infer/relate/type_relating.rs index 2dd37022319..3a3c73b44cb 100644 --- a/compiler/rustc_infer/src/infer/relate/type_relating.rs +++ b/compiler/rustc_infer/src/infer/relate/type_relating.rs @@ -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); } diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index 6de32dd0774..57b85a24a74 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -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(..) => { |
