diff options
| author | bors <bors@rust-lang.org> | 2025-01-29 02:12:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-29 02:12:12 +0000 |
| commit | 122fb29eb639aae852b9dcba0fd7aefc691be118 (patch) | |
| tree | 92fda274e3e94b69cd15f2fdaa9521ddf0b98b47 /compiler/rustc_traits | |
| parent | aeba3c60f506218396883cb57812de2f3e067112 (diff) | |
| parent | 4e3e91555cdd918827bec345667a1c119034b0d6 (diff) | |
| download | rust-122fb29eb639aae852b9dcba0fd7aefc691be118.tar.gz rust-122fb29eb639aae852b9dcba0fd7aefc691be118.zip | |
Auto merge of #136011 - compiler-errors:query-norm-vaniquishes-us, r=jackh726
Revert #135914: Remove usages of `QueryNormalizer` in the compiler Reverts #135914. r? jackh726
Diffstat (limited to 'compiler/rustc_traits')
| -rw-r--r-- | compiler/rustc_traits/src/type_op.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs index 506f1a7a1c6..e58ad639d20 100644 --- a/compiler/rustc_traits/src/type_op.rs +++ b/compiler/rustc_traits/src/type_op.rs @@ -7,12 +7,13 @@ use rustc_middle::traits::query::NoSolution; use rustc_middle::ty::{Clause, FnSig, ParamEnvAnd, PolyFnSig, Ty, TyCtxt, TypeFoldable}; use rustc_span::DUMMY_SP; use rustc_trait_selection::infer::InferCtxtBuilderExt; +use rustc_trait_selection::traits::query::normalize::QueryNormalizeExt; use rustc_trait_selection::traits::query::type_op::ascribe_user_type::{ AscribeUserType, type_op_ascribe_user_type_with_span, }; use rustc_trait_selection::traits::query::type_op::normalize::Normalize; use rustc_trait_selection::traits::query::type_op::prove_predicate::ProvePredicate; -use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt}; +use rustc_trait_selection::traits::{Normalized, Obligation, ObligationCause, ObligationCtxt}; pub(crate) fn provide(p: &mut Providers) { *p = Providers { @@ -43,7 +44,10 @@ where T: fmt::Debug + TypeFoldable<TyCtxt<'tcx>>, { let (param_env, Normalize { value }) = key.into_parts(); - Ok(ocx.normalize(&ObligationCause::dummy(), param_env, value)) + let Normalized { value, obligations } = + ocx.infcx.at(&ObligationCause::dummy(), param_env).query_normalize(value)?; + ocx.register_obligations(obligations); + Ok(value) } fn type_op_normalize_ty<'tcx>( |
