diff options
Diffstat (limited to 'compiler/rustc_middle/src/ty/flags.rs')
-rw-r--r-- | compiler/rustc_middle/src/ty/flags.rs | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs index b7eafc4b4..91241ff40 100644 --- a/compiler/rustc_middle/src/ty/flags.rs +++ b/compiler/rustc_middle/src/ty/flags.rs @@ -125,6 +125,16 @@ impl FlagComputation { self.bound_computation(ts, |flags, ts| flags.add_tys(ts)); } + ty::GeneratorWitnessMIR(_, substs) => { + let should_remove_further_specializable = + !self.flags.contains(TypeFlags::STILL_FURTHER_SPECIALIZABLE); + self.add_substs(substs); + if should_remove_further_specializable { + self.flags -= TypeFlags::STILL_FURTHER_SPECIALIZABLE; + } + self.add_flags(TypeFlags::HAS_TY_GENERATOR); + } + &ty::Closure(_, substs) => { let substs = substs.as_closure(); let should_remove_further_specializable = @@ -241,6 +251,10 @@ impl FlagComputation { self.add_ty(ty); self.add_region(region); } + ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => { + self.add_const(ct); + self.add_ty(ty); + } ty::PredicateKind::Subtype(ty::SubtypePredicate { a_is_expected: _, a, b }) => { self.add_ty(a); self.add_ty(b); @@ -254,10 +268,7 @@ impl FlagComputation { term, })) => { self.add_projection_ty(projection_ty); - match term.unpack() { - ty::TermKind::Ty(ty) => self.add_ty(ty), - ty::TermKind::Const(c) => self.add_const(c), - } + self.add_term(term); } ty::PredicateKind::WellFormed(arg) => { self.add_substs(slice::from_ref(&arg)); @@ -277,6 +288,10 @@ impl FlagComputation { self.add_ty(ty); } ty::PredicateKind::Ambiguous => {} + ty::PredicateKind::AliasEq(t1, t2) => { + self.add_term(t1); + self.add_term(t2); + } } } @@ -370,4 +385,11 @@ impl FlagComputation { } } } + + fn add_term(&mut self, term: ty::Term<'_>) { + match term.unpack() { + ty::TermKind::Ty(ty) => self.add_ty(ty), + ty::TermKind::Const(ct) => self.add_const(ct), + } + } } |