Use ControlFlow::is{break,continue}

This commit is contained in:
LeSeulArtichaut 2020-10-22 10:20:24 +02:00
parent 8e4cf0b3ed
commit 24e1a7e656
10 changed files with 25 additions and 25 deletions

View file

@ -869,8 +869,9 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
}
}
value.visit_with(&mut IllegalSelfTypeVisitor { tcx, trait_def_id, supertraits: None })
== ControlFlow::BREAK
value
.visit_with(&mut IllegalSelfTypeVisitor { tcx, trait_def_id, supertraits: None })
.is_break()
}
pub fn provide(providers: &mut ty::query::Providers) {

View file

@ -248,7 +248,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> {
let ty = self.tcx().normalize_erasing_regions(ty::ParamEnv::empty(), field_ty);
debug!("structural-match ADT: field_ty={:?}, ty={:?}", field_ty, ty);
if ty.visit_with(self) == ControlFlow::BREAK {
if ty.visit_with(self).is_break() {
// found an ADT without structural-match; halt visiting!
assert!(self.found.is_some());
return ControlFlow::BREAK;