@@ -15,6 +15,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
1515use rustc_session:: config:: nightly_options;
1616use rustc_span:: Span ;
1717
18+ use std:: ops:: ControlFlow ;
19+
1820pub type OpaqueTypeMap < ' tcx > = DefIdMap < OpaqueTypeDecl < ' tcx > > ;
1921
2022/// Information about the opaque types whose values we
@@ -691,26 +693,26 @@ impl<'tcx, OP> TypeVisitor<'tcx> for ConstrainOpaqueTypeRegionVisitor<OP>
691693where
692694 OP : FnMut ( ty:: Region < ' tcx > ) ,
693695{
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 < ( ) , ( ) > {
695697 t. as_ref ( ) . skip_binder ( ) . visit_with ( self ) ;
696- false // keep visiting
698+ ControlFlow :: CONTINUE
697699 }
698700
699- fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
701+ fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> ControlFlow < ( ) , ( ) > {
700702 match * r {
701703 // ignore bound regions, keep visiting
702- ty:: ReLateBound ( _, _) => false ,
704+ ty:: ReLateBound ( _, _) => ControlFlow :: CONTINUE ,
703705 _ => {
704706 ( self . op ) ( r) ;
705- false
707+ ControlFlow :: CONTINUE
706708 }
707709 }
708710 }
709711
710- fn visit_ty ( & mut self , ty : Ty < ' tcx > ) -> bool {
712+ fn visit_ty ( & mut self , ty : Ty < ' tcx > ) -> ControlFlow < ( ) , ( ) > {
711713 // We're only interested in types involving regions
712714 if !ty. flags ( ) . intersects ( ty:: TypeFlags :: HAS_FREE_REGIONS ) {
713- return false ; // keep visiting
715+ return ControlFlow :: CONTINUE ;
714716 }
715717
716718 match ty. kind ( ) {
@@ -745,7 +747,7 @@ where
745747 }
746748 }
747749
748- false
750+ ControlFlow :: CONTINUE
749751 }
750752}
751753
0 commit comments