11use rustc_data_structures:: fx:: FxHashSet ;
2- use rustc_errors:: ErrorGuaranteed ;
32use rustc_hir:: { def:: DefKind , def_id:: LocalDefId } ;
43use rustc_middle:: query:: Providers ;
54use rustc_middle:: ty:: util:: { CheckRegions , NotUniqueParam } ;
@@ -65,10 +64,9 @@ impl<'tcx> OpaqueTypeCollector<'tcx> {
6564}
6665
6766impl < ' tcx > TypeVisitor < TyCtxt < ' tcx > > for OpaqueTypeCollector < ' tcx > {
68- type BreakTy = ErrorGuaranteed ;
69-
7067 #[ 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 ) ?;
7270 match t. kind ( ) {
7371 ty:: Alias ( ty:: Opaque , alias_ty) if alias_ty. def_id . is_local ( ) => {
7472 if !self . seen . insert ( alias_ty. def_id . expect_local ( ) ) {
@@ -91,24 +89,20 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx> {
9189 trace ! ( ?pred) ;
9290 self . visit_spanned ( span, pred) ;
9391 }
94-
95- ControlFlow :: Continue ( ( ) )
9692 }
9793 Err ( NotUniqueParam :: NotParam ( arg) ) => {
98- let err = self . tcx . sess . emit_err ( NotParam {
94+ self . tcx . sess . emit_err ( NotParam {
9995 arg,
10096 span : self . span ( ) ,
10197 opaque_span : self . tcx . def_span ( alias_ty. def_id ) ,
10298 } ) ;
103- ControlFlow :: Break ( err)
10499 }
105100 Err ( NotUniqueParam :: DuplicateParam ( arg) ) => {
106- let err = self . tcx . sess . emit_err ( DuplicateArg {
101+ self . tcx . sess . emit_err ( DuplicateArg {
107102 arg,
108103 span : self . span ( ) ,
109104 opaque_span : self . tcx . def_span ( alias_ty. def_id ) ,
110105 } ) ;
111- ControlFlow :: Break ( err)
112106 }
113107 }
114108 }
@@ -157,10 +151,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx> {
157151 }
158152 }
159153 }
160- t. super_visit_with ( self )
161154 }
162- _ => t . super_visit_with ( self ) ,
155+ _ => { }
163156 }
157+ ControlFlow :: Continue ( ( ) )
164158 }
165159}
166160
0 commit comments