@@ -1086,7 +1086,7 @@ impl<'tcx> TypePrivacyVisitor<'tcx> {
1086
1086
adjustments. iter ( ) . try_for_each ( |adjustment| self . visit ( adjustment. target ) ) ?;
1087
1087
}
1088
1088
} ;
1089
- result == ControlFlow :: BREAK
1089
+ result. is_break ( )
1090
1090
}
1091
1091
1092
1092
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> {
1128
1128
self . span = hir_ty. span ;
1129
1129
if let Some ( typeck_results) = self . maybe_typeck_results {
1130
1130
// 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 ( ) {
1132
1132
return ;
1133
1133
}
1134
1134
} else {
1135
1135
// Types in signatures.
1136
1136
// FIXME: This is very ineffective. Ideally each HIR type should be converted
1137
1137
// 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 ( ) {
1139
1139
return ;
1140
1140
}
1141
1141
}
@@ -1157,16 +1157,17 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
1157
1157
) ;
1158
1158
1159
1159
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 ( ) {
1161
1161
return ;
1162
1162
}
1163
1163
}
1164
1164
1165
1165
for ( poly_predicate, _) in bounds. projection_bounds {
1166
1166
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 ( )
1170
1171
{
1171
1172
return ;
1172
1173
}
@@ -1193,7 +1194,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
1193
1194
// Method calls have to be checked specially.
1194
1195
self . span = span;
1195
1196
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 ( ) {
1197
1198
return ;
1198
1199
}
1199
1200
} else {
0 commit comments