1
1
use rustc_data_structures:: fx:: FxHashSet ;
2
- use rustc_errors:: ErrorGuaranteed ;
3
2
use rustc_hir:: { def:: DefKind , def_id:: LocalDefId } ;
4
3
use rustc_middle:: query:: Providers ;
5
4
use rustc_middle:: ty:: util:: { CheckRegions , NotUniqueParam } ;
@@ -65,10 +64,9 @@ impl<'tcx> OpaqueTypeCollector<'tcx> {
65
64
}
66
65
67
66
impl < ' tcx > TypeVisitor < TyCtxt < ' tcx > > for OpaqueTypeCollector < ' tcx > {
68
- type BreakTy = ErrorGuaranteed ;
69
-
70
67
#[ instrument( skip( self ) , ret, level = "trace" ) ]
71
- fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < ErrorGuaranteed > {
68
+ fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < !> {
69
+ t. super_visit_with ( self ) ?;
72
70
match t. kind ( ) {
73
71
ty:: Alias ( ty:: Opaque , alias_ty) if alias_ty. def_id . is_local ( ) => {
74
72
if !self . seen . insert ( alias_ty. def_id . expect_local ( ) ) {
@@ -91,24 +89,20 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx> {
91
89
trace ! ( ?pred) ;
92
90
self . visit_spanned ( span, pred) ;
93
91
}
94
-
95
- ControlFlow :: Continue ( ( ) )
96
92
}
97
93
Err ( NotUniqueParam :: NotParam ( arg) ) => {
98
- let err = self . tcx . sess . emit_err ( NotParam {
94
+ self . tcx . sess . emit_err ( NotParam {
99
95
arg,
100
96
span : self . span ( ) ,
101
97
opaque_span : self . tcx . def_span ( alias_ty. def_id ) ,
102
98
} ) ;
103
- ControlFlow :: Break ( err)
104
99
}
105
100
Err ( NotUniqueParam :: DuplicateParam ( arg) ) => {
106
- let err = self . tcx . sess . emit_err ( DuplicateArg {
101
+ self . tcx . sess . emit_err ( DuplicateArg {
107
102
arg,
108
103
span : self . span ( ) ,
109
104
opaque_span : self . tcx . def_span ( alias_ty. def_id ) ,
110
105
} ) ;
111
- ControlFlow :: Break ( err)
112
106
}
113
107
}
114
108
}
@@ -157,10 +151,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx> {
157
151
}
158
152
}
159
153
}
160
- t. super_visit_with ( self )
161
154
}
162
- _ => t . super_visit_with ( self ) ,
155
+ _ => { }
163
156
}
157
+ ControlFlow :: Continue ( ( ) )
164
158
}
165
159
}
166
160
0 commit comments