@@ -10,7 +10,6 @@ use rustc_hir::def_id::{DefId, LocalDefId};
1010use rustc_middle:: query:: Providers ;
1111use rustc_middle:: ty:: { self , CrateVariancesMap , GenericArgsRef , Ty , TyCtxt } ;
1212use rustc_middle:: ty:: { TypeSuperVisitable , TypeVisitable } ;
13- use std:: ops:: ControlFlow ;
1413
1514/// Defines the `TermsContext` basically houses an arena where we can
1615/// allocate terms.
@@ -89,15 +88,14 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
8988
9089 impl < ' tcx > OpaqueTypeLifetimeCollector < ' tcx > {
9190 #[ instrument( level = "trace" , skip( self ) , ret) ]
92- fn visit_opaque ( & mut self , def_id : DefId , args : GenericArgsRef < ' tcx > ) -> ControlFlow < ! > {
91+ fn visit_opaque ( & mut self , def_id : DefId , args : GenericArgsRef < ' tcx > ) {
9392 if def_id != self . root_def_id && self . tcx . is_descendant_of ( def_id, self . root_def_id ) {
9493 let child_variances = self . tcx . variances_of ( def_id) ;
9594 for ( a, v) in args. iter ( ) . zip_eq ( child_variances) {
9695 if * v != ty:: Bivariant {
97- a. visit_with ( self ) ? ;
96+ a. visit_with ( self ) ;
9897 }
9998 }
100- ControlFlow :: Continue ( ( ) )
10199 } else {
102100 args. visit_with ( self )
103101 }
@@ -106,20 +104,19 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
106104
107105 impl < ' tcx > ty:: TypeVisitor < TyCtxt < ' tcx > > for OpaqueTypeLifetimeCollector < ' tcx > {
108106 #[ instrument( level = "trace" , skip( self ) , ret) ]
109- fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
107+ fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) {
110108 if let ty:: RegionKind :: ReEarlyParam ( ebr) = r. kind ( ) {
111109 self . variances [ ebr. index as usize ] = ty:: Invariant ;
112110 }
113- ControlFlow :: Continue ( ( ) )
114111 }
115112
116113 #[ instrument( level = "trace" , skip( self ) , ret) ]
117- fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
114+ fn visit_ty ( & mut self , t : Ty < ' tcx > ) {
118115 match t. kind ( ) {
119116 ty:: Alias ( _, ty:: AliasTy { def_id, args, .. } )
120117 if matches ! ( self . tcx. def_kind( * def_id) , DefKind :: OpaqueTy ) =>
121118 {
122- self . visit_opaque ( * def_id, args)
119+ self . visit_opaque ( * def_id, args) ;
123120 }
124121 _ => t. super_visit_with ( self ) ,
125122 }
0 commit comments