Stop using BREAK & CONTINUE in compiler

Switching them to `Break(())` and `Continue(())` instead.

libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
This commit is contained in:
Scott McMurray 2023-01-17 23:17:13 -08:00
parent e08b379d5d
commit 925dc37313
31 changed files with 110 additions and 106 deletions

View file

@ -267,7 +267,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
debug!(?t, "root_visit_ty");
if t == self.opaque_identity_ty {
ControlFlow::CONTINUE
ControlFlow::Continue(())
} else {
t.visit_with(&mut ConstrainOpaqueTypeRegionVisitor {
tcx: self.tcx,
@ -282,7 +282,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
if self.references_parent_regions {
ControlFlow::Break(t)
} else {
ControlFlow::CONTINUE
ControlFlow::Continue(())
}
}
}
@ -1439,7 +1439,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> E
match *t.kind() {
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
self.0.push(def);
ControlFlow::CONTINUE
ControlFlow::Continue(())
}
_ => t.super_visit_with(self),
}

View file

@ -1428,7 +1428,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
}
fn visit_region(&mut self, _: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
ControlFlow::BREAK
ControlFlow::Break(())
}
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {