summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_traits/src/type_op.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /compiler/rustc_traits/src/type_op.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_traits/src/type_op.rs')
-rw-r--r--compiler/rustc_traits/src/type_op.rs24
1 files changed, 9 insertions, 15 deletions
diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs
index 9904acb1c..01b9a5640 100644
--- a/compiler/rustc_traits/src/type_op.rs
+++ b/compiler/rustc_traits/src/type_op.rs
@@ -2,9 +2,8 @@ use rustc_infer::infer::canonical::{Canonical, QueryResponse};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::query::Providers;
use rustc_middle::traits::query::NoSolution;
-use rustc_middle::traits::DefiningAnchor;
+use rustc_middle::ty::{Clause, ParamEnvAnd};
use rustc_middle::ty::{FnSig, Lift, PolyFnSig, Ty, TyCtxt, TypeFoldable};
-use rustc_middle::ty::{ParamEnvAnd, Predicate};
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::{
@@ -24,7 +23,7 @@ pub(crate) fn provide(p: &mut Providers) {
type_op_prove_predicate,
type_op_subtype,
type_op_normalize_ty,
- type_op_normalize_predicate,
+ type_op_normalize_clause,
type_op_normalize_fn_sig,
type_op_normalize_poly_fn_sig,
..*p
@@ -71,10 +70,10 @@ fn type_op_normalize_ty<'tcx>(
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, type_op_normalize)
}
-fn type_op_normalize_predicate<'tcx>(
+fn type_op_normalize_clause<'tcx>(
tcx: TyCtxt<'tcx>,
- canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Normalize<Predicate<'tcx>>>>,
-) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, Predicate<'tcx>>>, NoSolution> {
+ canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Normalize<Clause<'tcx>>>>,
+) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, Clause<'tcx>>>, NoSolution> {
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, type_op_normalize)
}
@@ -106,15 +105,10 @@ fn type_op_prove_predicate<'tcx>(
tcx: TyCtxt<'tcx>,
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
- // HACK This bubble is required for this test to pass:
- // impl-trait/issue-99642.rs
- tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query(
- &canonicalized,
- |ocx, key| {
- type_op_prove_predicate_with_cause(ocx, key, ObligationCause::dummy());
- Ok(())
- },
- )
+ tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
+ type_op_prove_predicate_with_cause(ocx, key, ObligationCause::dummy());
+ Ok(())
+ })
}
/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,