summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_infer/src/infer/canonical/query_response.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /compiler/rustc_infer/src/infer/canonical/query_response.rs
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_infer/src/infer/canonical/query_response.rs')
-rw-r--r--compiler/rustc_infer/src/infer/canonical/query_response.rs25
1 files changed, 8 insertions, 17 deletions
diff --git a/compiler/rustc_infer/src/infer/canonical/query_response.rs b/compiler/rustc_infer/src/infer/canonical/query_response.rs
index a299a3e57..996b1c40e 100644
--- a/compiler/rustc_infer/src/infer/canonical/query_response.rs
+++ b/compiler/rustc_infer/src/infer/canonical/query_response.rs
@@ -23,11 +23,10 @@ use rustc_index::vec::Idx;
use rustc_index::vec::IndexVec;
use rustc_middle::arena::ArenaAllocatable;
use rustc_middle::mir::ConstraintCategory;
-use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::relate::TypeRelation;
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
-use rustc_middle::ty::{self, BoundVar, Const, ToPredicate, Ty, TyCtxt};
+use rustc_middle::ty::{self, BoundVar, ToPredicate, Ty, TyCtxt};
use rustc_span::Span;
use std::fmt::Debug;
use std::iter;
@@ -570,10 +569,10 @@ impl<'tcx> InferCtxt<'tcx> {
let atom = match k1.unpack() {
GenericArgKind::Lifetime(r1) => {
- ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(r1, r2))
+ ty::PredicateKind::Clause(ty::Clause::RegionOutlives(ty::OutlivesPredicate(r1, r2)))
}
GenericArgKind::Type(t1) => {
- ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(t1, r2))
+ ty::PredicateKind::Clause(ty::Clause::TypeOutlives(ty::OutlivesPredicate(t1, r2)))
}
GenericArgKind::Const(..) => {
// Consts cannot outlive one another, so we don't expect to
@@ -581,9 +580,9 @@ impl<'tcx> InferCtxt<'tcx> {
span_bug!(cause.span, "unexpected const outlives {:?}", predicate);
}
};
- let predicate = predicate.0.rebind(atom).to_predicate(self.tcx);
+ let predicate = predicate.0.rebind(atom);
- Obligation::new(cause, param_env, predicate)
+ Obligation::new(self.tcx, cause, param_env, predicate)
}
/// Given two sets of values for the same set of canonical variables, unify them.
@@ -721,18 +720,14 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
self.obligations.push(Obligation {
cause: self.cause.clone(),
param_env: self.param_env,
- predicate: ty::Binder::dummy(ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(
- sup, sub,
+ predicate: ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::RegionOutlives(
+ ty::OutlivesPredicate(sup, sub),
)))
.to_predicate(self.infcx.tcx),
recursion_depth: 0,
});
}
- fn const_equate(&mut self, _a: Const<'tcx>, _b: Const<'tcx>) {
- span_bug!(self.cause.span(), "generic_const_exprs: unreachable `const_equate`");
- }
-
fn normalization() -> NormalizationStrategy {
NormalizationStrategy::Eager
}
@@ -741,11 +736,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
true
}
- fn register_opaque_type_obligations(
- &mut self,
- obligations: PredicateObligations<'tcx>,
- ) -> Result<(), TypeError<'tcx>> {
+ fn register_obligations(&mut self, obligations: PredicateObligations<'tcx>) {
self.obligations.extend(obligations);
- Ok(())
}
}