@@ -10,7 +10,6 @@ use rustc_hir::def_id::{DefId, LocalDefId};
10
10
use rustc_middle:: query:: Providers ;
11
11
use rustc_middle:: ty:: { self , CrateVariancesMap , GenericArgsRef , Ty , TyCtxt } ;
12
12
use rustc_middle:: ty:: { TypeSuperVisitable , TypeVisitable } ;
13
- use std:: ops:: ControlFlow ;
14
13
15
14
/// Defines the `TermsContext` basically houses an arena where we can
16
15
/// allocate terms.
@@ -89,15 +88,14 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
89
88
90
89
impl < ' tcx > OpaqueTypeLifetimeCollector < ' tcx > {
91
90
#[ 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 > ) {
93
92
if def_id != self . root_def_id && self . tcx . is_descendant_of ( def_id, self . root_def_id ) {
94
93
let child_variances = self . tcx . variances_of ( def_id) ;
95
94
for ( a, v) in args. iter ( ) . zip_eq ( child_variances) {
96
95
if * v != ty:: Bivariant {
97
- a. visit_with ( self ) ? ;
96
+ a. visit_with ( self ) ;
98
97
}
99
98
}
100
- ControlFlow :: Continue ( ( ) )
101
99
} else {
102
100
args. visit_with ( self )
103
101
}
@@ -106,20 +104,19 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
106
104
107
105
impl < ' tcx > ty:: TypeVisitor < TyCtxt < ' tcx > > for OpaqueTypeLifetimeCollector < ' tcx > {
108
106
#[ 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 > ) {
110
108
if let ty:: RegionKind :: ReEarlyParam ( ebr) = r. kind ( ) {
111
109
self . variances [ ebr. index as usize ] = ty:: Invariant ;
112
110
}
113
- ControlFlow :: Continue ( ( ) )
114
111
}
115
112
116
113
#[ 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 > ) {
118
115
match t. kind ( ) {
119
116
ty:: Alias ( _, ty:: AliasTy { def_id, args, .. } )
120
117
if matches ! ( self . tcx. def_kind( * def_id) , DefKind :: OpaqueTy ) =>
121
118
{
122
- self . visit_opaque ( * def_id, args)
119
+ self . visit_opaque ( * def_id, args) ;
123
120
}
124
121
_ => t. super_visit_with ( self ) ,
125
122
}
0 commit comments