diff options
| -rw-r--r-- | compiler/rustc_middle/src/ty/structural_impls.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/visit.rs | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 590342a6952..e440a8a3912 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -764,16 +764,6 @@ impl<'tcx> ir::TypeVisitable<'tcx> for ty::Predicate<'tcx> { fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { visitor.visit_predicate(*self) } - - #[inline] - fn has_vars_bound_at_or_above(&self, binder: ty::DebruijnIndex) -> bool { - self.outer_exclusive_binder() > binder - } - - #[inline] - fn has_type_flags(&self, flags: ty::TypeFlags) -> bool { - self.flags().intersects(flags) - } } impl<'tcx> TypeSuperFoldable<'tcx> for ty::Predicate<'tcx> { diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs index c292dc42720..793b84d4d9a 100644 --- a/compiler/rustc_middle/src/ty/visit.rs +++ b/compiler/rustc_middle/src/ty/visit.rs @@ -44,7 +44,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sso::SsoHashSet; use std::ops::ControlFlow; -pub trait TypeVisitable<'tcx> = ir::TypeVisitable<'tcx>; +pub trait TypeVisitable<'tcx> = ir::TypeVisitable<'tcx> + ir::TypeVisitableExt<'tcx>; pub trait TypeSuperVisitable<'tcx> = ir::TypeSuperVisitable<'tcx>; pub trait TypeVisitor<'tcx> = ir::TypeVisitor<'tcx>; @@ -74,7 +74,9 @@ pub mod ir { /// `V::visit_ty`). This is where control transfers from `TypeFoldable` to /// `TypeVisitor`. fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy>; + } + pub trait TypeVisitableExt<'tcx>: TypeVisitable<'tcx> { /// Returns `true` if `self` has any late-bound regions that are either /// bound by `binder` or bound by some binder outside of `binder`. /// If `binder` is `ty::INNERMOST`, this indicates whether @@ -197,6 +199,8 @@ pub mod ir { } } + impl<'tcx, T: TypeVisitable<'tcx>> TypeVisitableExt<'tcx> for T {} + pub trait TypeSuperVisitable<'tcx>: TypeVisitable<'tcx> { /// Provides a default visit for a type of interest. This should only be /// called within `TypeVisitor` methods, when a non-custom traversal is |
