3030//!
3131//! These methods return true to indicate that the visitor has found what it is
3232//! looking for, and does not need to visit anything else.
33-
34- use crate :: ty:: structural_impls:: PredicateVisitor ;
3533use crate :: ty:: { self , flags:: FlagComputation , Binder , Ty , TyCtxt , TypeFlags } ;
3634use rustc_hir as hir;
3735use rustc_hir:: def_id:: DefId ;
@@ -211,6 +209,10 @@ pub trait TypeVisitor<'tcx>: Sized {
211209 fn visit_const ( & mut self , c : & ' tcx ty:: Const < ' tcx > ) -> bool {
212210 c. super_visit_with ( self )
213211 }
212+
213+ fn visit_predicate ( & mut self , p : ty:: Predicate < ' tcx > ) -> bool {
214+ p. super_visit_with ( self )
215+ }
214216}
215217
216218///////////////////////////////////////////////////////////////////////////
@@ -868,9 +870,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
868870 _ => ct. super_visit_with ( self ) ,
869871 }
870872 }
871- }
872873
873- impl < ' tcx > PredicateVisitor < ' tcx > for HasEscapingVarsVisitor {
874874 fn visit_predicate ( & mut self , predicate : ty:: Predicate < ' tcx > ) -> bool {
875875 predicate. inner . outer_exclusive_binder > self . outer_index
876876 }
@@ -903,9 +903,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
903903 debug ! ( "HasTypeFlagsVisitor: c={:?} c.flags={:?} self.flags={:?}" , c, flags, self . flags) ;
904904 flags. intersects ( self . flags )
905905 }
906- }
907906
908- impl < ' tcx > PredicateVisitor < ' tcx > for HasTypeFlagsVisitor {
909907 fn visit_predicate ( & mut self , predicate : ty:: Predicate < ' tcx > ) -> bool {
910908 debug ! (
911909 "HasTypeFlagsVisitor: predicate={:?} predicate.flags={:?} self.flags={:?}" ,
@@ -914,6 +912,7 @@ impl<'tcx> PredicateVisitor<'tcx> for HasTypeFlagsVisitor {
914912 predicate. inner . flags . intersects ( self . flags )
915913 }
916914}
915+
917916/// Collects all the late-bound regions at the innermost binding level
918917/// into a hash set.
919918struct LateBoundRegionsCollector {
0 commit comments