diff options
| author | bors <bors@rust-lang.org> | 2022-09-07 13:49:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-07 13:49:58 +0000 |
| commit | a4d034126da8ff42590325622b1861c2597e870b (patch) | |
| tree | 0136a885f398dded0b25e1021f6b642b510703e6 /compiler/rustc_trait_selection/src/traits | |
| parent | e7c7aa7288559f8e5ea7ce3543ff946b09783628 (diff) | |
| parent | 79db32b64ec946afbef2ed50282f03b71d933480 (diff) | |
| download | rust-a4d034126da8ff42590325622b1861c2597e870b.tar.gz rust-a4d034126da8ff42590325622b1861c2597e870b.zip | |
Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr
Shrink `PredicateS` r? `@ghost`
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/auto_trait.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/wf.rs | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 1223c7ced7a..98e93ad3fc5 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -10,7 +10,7 @@ use crate::traits::project::ProjectAndUnifyResult; use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::ty::fold::{TypeFolder, TypeSuperFoldable}; use rustc_middle::ty::visit::TypeVisitable; -use rustc_middle::ty::{Region, RegionVid, Term}; +use rustc_middle::ty::{Region, RegionVid}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; @@ -612,7 +612,7 @@ impl<'tcx> AutoTraitFinder<'tcx> { } fn is_self_referential_projection(&self, p: ty::PolyProjectionPredicate<'_>) -> bool { - if let Term::Ty(ty) = p.term().skip_binder() { + if let Some(ty) = p.term().skip_binder().ty() { matches!(ty.kind(), ty::Projection(proj) if proj == &p.skip_binder().projection_ty) } else { false diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 398635674ab..76c1ade0680 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -552,7 +552,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> { ) .ok() .flatten() - .unwrap_or_else(|| ty::Term::Ty(ty.super_fold_with(self))) + .unwrap_or_else(|| ty.super_fold_with(self).into()) }; // For cases like #95134 we would like to catch overflows early // otherwise they slip away away and cause ICE. diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index bb6009cb22a..018ead2e130 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -129,9 +129,9 @@ pub fn predicate_obligations<'a, 'tcx>( } ty::PredicateKind::Projection(t) => { wf.compute_projection(t.projection_ty); - wf.compute(match t.term { - ty::Term::Ty(ty) => ty.into(), - ty::Term::Const(c) => c.into(), + wf.compute(match t.term.unpack() { + ty::TermKind::Ty(ty) => ty.into(), + ty::TermKind::Const(c) => c.into(), }) } ty::PredicateKind::WellFormed(arg) => { |
