diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
commit | 4547b622d8d29df964fa2914213088b148c498fc (patch) | |
tree | 9fc6b25f3c3add6b745be9a2400a6e96140046e9 /compiler/rustc_infer/src/traits/util.rs | |
parent | Releasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-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 '')
-rw-r--r-- | compiler/rustc_infer/src/traits/util.rs | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index e12c069dc..512e6079f 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -141,7 +141,7 @@ impl<'tcx> Elaborator<'tcx> { let bound_predicate = obligation.predicate.kind(); match bound_predicate.skip_binder() { - ty::PredicateKind::Trait(data) => { + ty::PredicateKind::Clause(ty::Clause::Trait(data)) => { // Get predicates declared on the trait. let predicates = tcx.super_predicates_of(data.def_id()); @@ -184,7 +184,7 @@ impl<'tcx> Elaborator<'tcx> { // Currently, we do not "elaborate" predicates like `X -> Y`, // though conceivably we might. } - ty::PredicateKind::Projection(..) => { + ty::PredicateKind::Clause(ty::Clause::Projection(..)) => { // Nothing to elaborate in a projection predicate. } ty::PredicateKind::ClosureKind(..) => { @@ -198,10 +198,13 @@ impl<'tcx> Elaborator<'tcx> { // Currently, we do not elaborate const-equate // predicates. } - ty::PredicateKind::RegionOutlives(..) => { + ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..)) => { // Nothing to elaborate from `'a: 'b`. } - ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_max, r_min)) => { + ty::PredicateKind::Clause(ty::Clause::TypeOutlives(ty::OutlivesPredicate( + ty_max, + r_min, + ))) => { // We know that `T: 'a` for some type `T`. We can // often elaborate this. For example, if we know that // `[U]: 'a`, that implies that `U: 'a`. Similarly, if @@ -231,16 +234,16 @@ impl<'tcx> Elaborator<'tcx> { if r.is_late_bound() { None } else { - Some(ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate( - r, r_min, + Some(ty::PredicateKind::Clause(ty::Clause::RegionOutlives( + ty::OutlivesPredicate(r, r_min), ))) } } Component::Param(p) => { let ty = tcx.mk_ty_param(p.index, p.name); - Some(ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate( - ty, r_min, + Some(ty::PredicateKind::Clause(ty::Clause::TypeOutlives( + ty::OutlivesPredicate(ty, r_min), ))) } @@ -248,8 +251,8 @@ impl<'tcx> Elaborator<'tcx> { Component::Opaque(def_id, substs) => { let ty = tcx.mk_opaque(def_id, substs); - Some(ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate( - ty, r_min, + Some(ty::PredicateKind::Clause(ty::Clause::TypeOutlives( + ty::OutlivesPredicate(ty, r_min), ))) } @@ -258,8 +261,8 @@ impl<'tcx> Elaborator<'tcx> { // With this, we can deduce that `<Bar as Baz>::Assoc: 'a`. let ty = tcx.mk_projection(projection.item_def_id, projection.substs); - Some(ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate( - ty, r_min, + Some(ty::PredicateKind::Clause(ty::Clause::TypeOutlives( + ty::OutlivesPredicate(ty, r_min), ))) } @@ -285,6 +288,7 @@ impl<'tcx> Elaborator<'tcx> { ty::PredicateKind::TypeWellFormedFromEnv(..) => { // Nothing to elaborate } + ty::PredicateKind::Ambiguous => {} } } } |