result
}
- pub fn for_predicate<'tcx>(binder: ty::Binder<'tcx, ty::PredicateKind<'_>>) -> FlagComputation {
+ pub fn for_predicate(binder: ty::Binder<'_, ty::PredicateKind<'_>>) -> FlagComputation {
let mut result = FlagComputation::new();
result.add_predicate(binder);
result
{
let mut computation = FlagComputation::new();
- if !value.bound_vars().is_empty() {
- computation.flags = computation.flags | TypeFlags::HAS_RE_LATE_BOUND;
+ for bv in value.bound_vars() {
+ match bv {
+ ty::BoundVariableKind::Ty(_) => {
+ computation.flags |= TypeFlags::HAS_TY_LATE_BOUND;
+ }
+ ty::BoundVariableKind::Region(_) => {
+ computation.flags |= TypeFlags::HAS_RE_LATE_BOUND;
+ }
+ ty::BoundVariableKind::Const => {
+ computation.flags |= TypeFlags::HAS_CT_LATE_BOUND;
+ }
+ }
}
f(&mut computation, value.skip_binder());
&ty::Bound(debruijn, _) => {
self.add_bound_var(debruijn);
+ self.add_flags(TypeFlags::HAS_TY_LATE_BOUND);
}
&ty::Placeholder(..) => {
}
ty::ConstKind::Bound(debruijn, _) => {
self.add_bound_var(debruijn);
+ self.add_flags(TypeFlags::HAS_CT_LATE_BOUND);
}
ty::ConstKind::Param(_) => {
self.add_flags(TypeFlags::HAS_CT_PARAM);