diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-28 16:09:06 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-28 16:09:29 +0000 |
| commit | 75e15f7cf4e55ed9572781930ee8babcaa256a47 (patch) | |
| tree | a76302df4cb5fe9f0f4f625bda0e030b4ceb1821 /compiler/rustc_trait_selection/src | |
| parent | ef324565d071c6d7e2477a195648549e33d6a465 (diff) | |
| download | rust-75e15f7cf4e55ed9572781930ee8babcaa256a47.tar.gz rust-75e15f7cf4e55ed9572781930ee8babcaa256a47.zip | |
Deeply normalize obligations in refining_impl_trait
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/engine.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/engine.rs b/compiler/rustc_trait_selection/src/traits/engine.rs index 1aaadf6cf04..e789e9c2b6e 100644 --- a/compiler/rustc_trait_selection/src/traits/engine.rs +++ b/compiler/rustc_trait_selection/src/traits/engine.rs @@ -107,6 +107,15 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> { self.register_infer_ok_obligations(infer_ok) } + pub fn deeply_normalize<T: TypeFoldable<TyCtxt<'tcx>>>( + &self, + cause: &ObligationCause<'tcx>, + param_env: ty::ParamEnv<'tcx>, + value: T, + ) -> Result<T, Vec<FulfillmentError<'tcx>>> { + self.infcx.at(cause, param_env).deeply_normalize(value, &mut **self.engine.borrow_mut()) + } + /// Makes `expected <: actual`. pub fn eq_exp<T>( &self, |
