diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-15 21:57:41 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-16 14:24:22 -0400 |
| commit | 138881b315e41ccadaa5a64df6793cf9f05b542f (patch) | |
| tree | 4da78fb053524bf6153feec5bcb94b02ec1692bb /compiler/rustc_infer/src/traits/mod.rs | |
| parent | 26846556021a9800d35bdb1de4d6d3b988c6d22f (diff) | |
| download | rust-138881b315e41ccadaa5a64df6793cf9f05b542f.tar.gz rust-138881b315e41ccadaa5a64df6793cf9f05b542f.zip | |
Uplift Goal to rustc_type_ir
Diffstat (limited to 'compiler/rustc_infer/src/traits/mod.rs')
| -rw-r--r-- | compiler/rustc_infer/src/traits/mod.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_infer/src/traits/mod.rs b/compiler/rustc_infer/src/traits/mod.rs index f8999689241..d5def46ad3a 100644 --- a/compiler/rustc_infer/src/traits/mod.rs +++ b/compiler/rustc_infer/src/traits/mod.rs @@ -78,9 +78,9 @@ impl<T: Hash> Hash for Obligation<'_, T> { } } -impl<'tcx, P> From<Obligation<'tcx, P>> for solve::Goal<'tcx, P> { +impl<'tcx, P> From<Obligation<'tcx, P>> for ty::Goal<'tcx, P> { fn from(value: Obligation<'tcx, P>) -> Self { - solve::Goal { param_env: value.param_env, predicate: value.predicate } + ty::Goal { param_env: value.param_env, predicate: value.predicate } } } @@ -155,7 +155,7 @@ impl<'tcx, O> Obligation<'tcx, O> { tcx: TyCtxt<'tcx>, cause: ObligationCause<'tcx>, param_env: ty::ParamEnv<'tcx>, - predicate: impl Upcast<'tcx, O>, + predicate: impl Upcast<TyCtxt<'tcx>, O>, ) -> Obligation<'tcx, O> { Self::with_depth(tcx, cause, 0, param_env, predicate) } @@ -173,7 +173,7 @@ impl<'tcx, O> Obligation<'tcx, O> { cause: ObligationCause<'tcx>, recursion_depth: usize, param_env: ty::ParamEnv<'tcx>, - predicate: impl Upcast<'tcx, O>, + predicate: impl Upcast<TyCtxt<'tcx>, O>, ) -> Obligation<'tcx, O> { let predicate = predicate.upcast(tcx); Obligation { cause, param_env, recursion_depth, predicate } @@ -184,12 +184,16 @@ impl<'tcx, O> Obligation<'tcx, O> { span: Span, body_id: LocalDefId, param_env: ty::ParamEnv<'tcx>, - trait_ref: impl Upcast<'tcx, O>, + trait_ref: impl Upcast<TyCtxt<'tcx>, O>, ) -> Obligation<'tcx, O> { Obligation::new(tcx, ObligationCause::misc(span, body_id), param_env, trait_ref) } - pub fn with<P>(&self, tcx: TyCtxt<'tcx>, value: impl Upcast<'tcx, P>) -> Obligation<'tcx, P> { + pub fn with<P>( + &self, + tcx: TyCtxt<'tcx>, + value: impl Upcast<TyCtxt<'tcx>, P>, + ) -> Obligation<'tcx, P> { Obligation::with_depth(tcx, self.cause.clone(), self.recursion_depth, self.param_env, value) } } |
