@@ -1086,7 +1086,7 @@ impl<'tcx> TypePrivacyVisitor<'tcx> {
10861086 adjustments. iter ( ) . try_for_each ( |adjustment| self . visit ( adjustment. target ) ) ?;
10871087 }
10881088 } ;
1089- result == ControlFlow :: BREAK
1089+ result. is_break ( )
10901090 }
10911091
10921092 fn check_def_id ( & mut self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
@@ -1128,14 +1128,14 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
11281128 self . span = hir_ty. span ;
11291129 if let Some ( typeck_results) = self . maybe_typeck_results {
11301130 // Types in bodies.
1131- if self . visit ( typeck_results. node_type ( hir_ty. hir_id ) ) == ControlFlow :: BREAK {
1131+ if self . visit ( typeck_results. node_type ( hir_ty. hir_id ) ) . is_break ( ) {
11321132 return ;
11331133 }
11341134 } else {
11351135 // Types in signatures.
11361136 // FIXME: This is very ineffective. Ideally each HIR type should be converted
11371137 // into a semantic type only once and the result should be cached somehow.
1138- if self . visit ( rustc_typeck:: hir_ty_to_ty ( self . tcx , hir_ty) ) == ControlFlow :: BREAK {
1138+ if self . visit ( rustc_typeck:: hir_ty_to_ty ( self . tcx , hir_ty) ) . is_break ( ) {
11391139 return ;
11401140 }
11411141 }
@@ -1157,16 +1157,17 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
11571157 ) ;
11581158
11591159 for ( trait_predicate, _, _) in bounds. trait_bounds {
1160- if self . visit_trait ( trait_predicate. skip_binder ( ) ) == ControlFlow :: BREAK {
1160+ if self . visit_trait ( trait_predicate. skip_binder ( ) ) . is_break ( ) {
11611161 return ;
11621162 }
11631163 }
11641164
11651165 for ( poly_predicate, _) in bounds. projection_bounds {
11661166 let tcx = self . tcx ;
1167- if self . visit ( poly_predicate. skip_binder ( ) . ty ) == ControlFlow :: BREAK
1168- || self . visit_trait ( poly_predicate. skip_binder ( ) . projection_ty . trait_ref ( tcx) )
1169- == ControlFlow :: BREAK
1167+ if self . visit ( poly_predicate. skip_binder ( ) . ty ) . is_break ( )
1168+ || self
1169+ . visit_trait ( poly_predicate. skip_binder ( ) . projection_ty . trait_ref ( tcx) )
1170+ . is_break ( )
11701171 {
11711172 return ;
11721173 }
@@ -1193,7 +1194,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
11931194 // Method calls have to be checked specially.
11941195 self . span = span;
11951196 if let Some ( def_id) = self . typeck_results ( ) . type_dependent_def_id ( expr. hir_id ) {
1196- if self . visit ( self . tcx . type_of ( def_id) ) == ControlFlow :: BREAK {
1197+ if self . visit ( self . tcx . type_of ( def_id) ) . is_break ( ) {
11971198 return ;
11981199 }
11991200 } else {
0 commit comments