30
30
//!
31
31
//! These methods return true to indicate that the visitor has found what it is
32
32
//! looking for, and does not need to visit anything else.
33
-
34
- use crate :: ty:: structural_impls:: PredicateVisitor ;
35
33
use crate :: ty:: { self , flags:: FlagComputation , Binder , Ty , TyCtxt , TypeFlags } ;
36
34
use rustc_hir as hir;
37
35
use rustc_hir:: def_id:: DefId ;
@@ -211,6 +209,10 @@ pub trait TypeVisitor<'tcx>: Sized {
211
209
fn visit_const ( & mut self , c : & ' tcx ty:: Const < ' tcx > ) -> bool {
212
210
c. super_visit_with ( self )
213
211
}
212
+
213
+ fn visit_predicate ( & mut self , p : ty:: Predicate < ' tcx > ) -> bool {
214
+ p. super_visit_with ( self )
215
+ }
214
216
}
215
217
216
218
///////////////////////////////////////////////////////////////////////////
@@ -868,9 +870,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
868
870
_ => ct. super_visit_with ( self ) ,
869
871
}
870
872
}
871
- }
872
873
873
- impl < ' tcx > PredicateVisitor < ' tcx > for HasEscapingVarsVisitor {
874
874
fn visit_predicate ( & mut self , predicate : ty:: Predicate < ' tcx > ) -> bool {
875
875
predicate. inner . outer_exclusive_binder > self . outer_index
876
876
}
@@ -903,9 +903,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
903
903
debug ! ( "HasTypeFlagsVisitor: c={:?} c.flags={:?} self.flags={:?}" , c, flags, self . flags) ;
904
904
flags. intersects ( self . flags )
905
905
}
906
- }
907
906
908
- impl < ' tcx > PredicateVisitor < ' tcx > for HasTypeFlagsVisitor {
909
907
fn visit_predicate ( & mut self , predicate : ty:: Predicate < ' tcx > ) -> bool {
910
908
debug ! (
911
909
"HasTypeFlagsVisitor: predicate={:?} predicate.flags={:?} self.flags={:?}" ,
@@ -914,6 +912,7 @@ impl<'tcx> PredicateVisitor<'tcx> for HasTypeFlagsVisitor {
914
912
predicate. inner . flags . intersects ( self . flags )
915
913
}
916
914
}
915
+
917
916
/// Collects all the late-bound regions at the innermost binding level
918
917
/// into a hash set.
919
918
struct LateBoundRegionsCollector {
0 commit comments