@@ -15,6 +15,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
15
15
use rustc_session:: config:: nightly_options;
16
16
use rustc_span:: Span ;
17
17
18
+ use std:: ops:: ControlFlow ;
19
+
18
20
pub type OpaqueTypeMap < ' tcx > = DefIdMap < OpaqueTypeDecl < ' tcx > > ;
19
21
20
22
/// Information about the opaque types whose values we
@@ -691,26 +693,26 @@ impl<'tcx, OP> TypeVisitor<'tcx> for ConstrainOpaqueTypeRegionVisitor<OP>
691
693
where
692
694
OP : FnMut ( ty:: Region < ' tcx > ) ,
693
695
{
694
- fn visit_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > ) -> bool {
696
+ fn visit_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > ) -> ControlFlow < ( ) , ( ) > {
695
697
t. as_ref ( ) . skip_binder ( ) . visit_with ( self ) ;
696
- false // keep visiting
698
+ ControlFlow :: CONTINUE
697
699
}
698
700
699
- fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
701
+ fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> ControlFlow < ( ) , ( ) > {
700
702
match * r {
701
703
// ignore bound regions, keep visiting
702
- ty:: ReLateBound ( _, _) => false ,
704
+ ty:: ReLateBound ( _, _) => ControlFlow :: CONTINUE ,
703
705
_ => {
704
706
( self . op ) ( r) ;
705
- false
707
+ ControlFlow :: CONTINUE
706
708
}
707
709
}
708
710
}
709
711
710
- fn visit_ty ( & mut self , ty : Ty < ' tcx > ) -> bool {
712
+ fn visit_ty ( & mut self , ty : Ty < ' tcx > ) -> ControlFlow < ( ) , ( ) > {
711
713
// We're only interested in types involving regions
712
714
if !ty. flags ( ) . intersects ( ty:: TypeFlags :: HAS_FREE_REGIONS ) {
713
- return false ; // keep visiting
715
+ return ControlFlow :: CONTINUE ;
714
716
}
715
717
716
718
match ty. kind ( ) {
@@ -745,7 +747,7 @@ where
745
747
}
746
748
}
747
749
748
- false
750
+ ControlFlow :: CONTINUE
749
751
}
750
752
}
751
753
0 commit comments