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

@ -225,7 +225,7 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
/// `align_offset(ptr, target_align)` needs special handling in const eval, because the pointer /// `align_offset(ptr, target_align)` needs special handling in const eval, because the pointer
/// may not have an address. /// may not have an address.
/// ///
/// If `ptr` does have a known address, then we return `CONTINUE` and the function call should /// If `ptr` does have a known address, then we return `Continue(())` and the function call should
/// proceed as normal. /// proceed as normal.
/// ///
/// If `ptr` doesn't have an address, but its underlying allocation's alignment is at most /// If `ptr` doesn't have an address, but its underlying allocation's alignment is at most
@ -273,18 +273,18 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
ret, ret,
StackPopUnwind::NotAllowed, StackPopUnwind::NotAllowed,
)?; )?;
Ok(ControlFlow::BREAK) Ok(ControlFlow::Break(()))
} else { } else {
// Not alignable in const, return `usize::MAX`. // Not alignable in const, return `usize::MAX`.
let usize_max = Scalar::from_machine_usize(self.machine_usize_max(), self); let usize_max = Scalar::from_machine_usize(self.machine_usize_max(), self);
self.write_scalar(usize_max, dest)?; self.write_scalar(usize_max, dest)?;
self.return_to_block(ret)?; self.return_to_block(ret)?;
Ok(ControlFlow::BREAK) Ok(ControlFlow::Break(()))
} }
} }
Err(_addr) => { Err(_addr) => {
// The pointer has an address, continue with function call. // The pointer has an address, continue with function call.
Ok(ControlFlow::CONTINUE) Ok(ControlFlow::Continue(()))
} }
} }
} }

View File

@ -26,7 +26,7 @@ where
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if !ty.needs_subst() { if !ty.needs_subst() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
match *ty.kind() { match *ty.kind() {
@ -48,7 +48,7 @@ where
return subst.visit_with(self); return subst.visit_with(self);
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => ty.super_visit_with(self), _ => ty.super_visit_with(self),
} }

View File

@ -317,12 +317,12 @@ where
_node: G::Node, _node: G::Node,
_prior_status: Option<NodeStatus>, _prior_status: Option<NodeStatus>,
) -> ControlFlow<Self::BreakVal> { ) -> ControlFlow<Self::BreakVal> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
/// Called after all nodes reachable from this one have been examined. /// Called after all nodes reachable from this one have been examined.
fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> { fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
/// Behave as if no edges exist from `source` to `target`. /// Behave as if no edges exist from `source` to `target`.
@ -346,8 +346,8 @@ where
prior_status: Option<NodeStatus>, prior_status: Option<NodeStatus>,
) -> ControlFlow<Self::BreakVal> { ) -> ControlFlow<Self::BreakVal> {
match prior_status { match prior_status {
Some(NodeStatus::Visited) => ControlFlow::BREAK, Some(NodeStatus::Visited) => ControlFlow::Break(()),
_ => ControlFlow::CONTINUE, _ => ControlFlow::Continue(()),
} }
} }
} }

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> { fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
debug!(?t, "root_visit_ty"); debug!(?t, "root_visit_ty");
if t == self.opaque_identity_ty { if t == self.opaque_identity_ty {
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
t.visit_with(&mut ConstrainOpaqueTypeRegionVisitor { t.visit_with(&mut ConstrainOpaqueTypeRegionVisitor {
tcx: self.tcx, tcx: self.tcx,
@ -282,7 +282,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
if self.references_parent_regions { if self.references_parent_regions {
ControlFlow::Break(t) ControlFlow::Break(t)
} else { } 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() { match *t.kind() {
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => { ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
self.0.push(def); self.0.push(def);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => t.super_visit_with(self), _ => 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> { 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> { fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {

View File

@ -416,13 +416,13 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
if t != self.self_ty_root { if t != self.self_ty_root {
for impl_def_id in tcx.non_blanket_impls_for_ty(self.trait_def_id, t) { for impl_def_id in tcx.non_blanket_impls_for_ty(self.trait_def_id, t) {
match tcx.impl_polarity(impl_def_id) { match tcx.impl_polarity(impl_def_id) {
ImplPolarity::Negative => return ControlFlow::BREAK, ImplPolarity::Negative => return ControlFlow::Break(()),
ImplPolarity::Reservation => {} ImplPolarity::Reservation => {}
// FIXME(@lcnr): That's probably not good enough, idk // FIXME(@lcnr): That's probably not good enough, idk
// //
// We might just want to take the rustdoc code and somehow avoid // We might just want to take the rustdoc code and somehow avoid
// explicit impls for `Self`. // explicit impls for `Self`.
ImplPolarity::Positive => return ControlFlow::CONTINUE, ImplPolarity::Positive => return ControlFlow::Continue(()),
} }
} }
} }
@ -440,7 +440,7 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => t.super_visit_with(self), _ => t.super_visit_with(self),
} }

View File

@ -61,7 +61,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
match *t.kind() { match *t.kind() {
ty::Alias(ty::Projection, ..) if !self.include_nonconstraining => { ty::Alias(ty::Projection, ..) if !self.include_nonconstraining => {
// projections are not injective // projections are not injective
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
ty::Param(data) => { ty::Param(data) => {
self.parameters.push(Parameter::from(data)); self.parameters.push(Parameter::from(data));
@ -76,7 +76,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
if let ty::ReEarlyBound(data) = *r { if let ty::ReEarlyBound(data) = *r {
self.parameters.push(Parameter::from(data)); self.parameters.push(Parameter::from(data));
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {

View File

@ -92,7 +92,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
a.visit_with(self)?; a.visit_with(self)?;
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
substs.visit_with(self) substs.visit_with(self)
} }

View File

@ -236,7 +236,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if t == self.expected_ty { if t == self.expected_ty {
ControlFlow::BREAK ControlFlow::Break(())
} else { } else {
t.super_visit_with(self) t.super_visit_with(self)
} }

View File

@ -543,7 +543,7 @@ impl<'tcx> TypeVisitor<'tcx> for TraitObjectVisitor {
if let Some(def_id) = preds.principal_def_id() { if let Some(def_id) = preds.principal_def_id() {
self.0.insert(def_id); self.0.insert(def_id);
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => t.super_visit_with(self), _ => t.super_visit_with(self),
} }

View File

@ -849,7 +849,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
t.super_visit_with(self); t.super_visit_with(self);
self.target_index.shift_out(1); self.target_index.shift_out(1);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
@ -863,7 +863,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
_ => {} _ => {}
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -440,16 +440,16 @@ where
t: &ty::Binder<'tcx, T>, t: &ty::Binder<'tcx, T>,
) -> ControlFlow<Self::BreakTy> { ) -> ControlFlow<Self::BreakTy> {
t.super_visit_with(self); t.super_visit_with(self);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
match *r { match *r {
// ignore bound regions, keep visiting // ignore bound regions, keep visiting
ty::ReLateBound(_, _) => ControlFlow::CONTINUE, ty::ReLateBound(_, _) => ControlFlow::Continue(()),
_ => { _ => {
(self.op)(r); (self.op)(r);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -457,7 +457,7 @@ where
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
// We're only interested in types involving regions // We're only interested in types involving regions
if !ty.flags().intersects(ty::TypeFlags::HAS_FREE_REGIONS) { if !ty.flags().intersects(ty::TypeFlags::HAS_FREE_REGIONS) {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
match ty.kind() { match ty.kind() {
@ -507,7 +507,7 @@ where
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -147,7 +147,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeOrConstFinder<'a, 'tcx> {
} else if !t.has_non_region_infer() { } else if !t.has_non_region_infer() {
// All const/type variables in inference types must already be resolved, // All const/type variables in inference types must already be resolved,
// no need to visit the contents. // no need to visit the contents.
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
// Otherwise, keep visiting. // Otherwise, keep visiting.
t.super_visit_with(self) t.super_visit_with(self)
@ -178,7 +178,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeOrConstFinder<'a, 'tcx> {
} else if !ct.has_non_region_infer() { } else if !ct.has_non_region_infer() {
// All const/type variables in inference types must already be resolved, // All const/type variables in inference types must already be resolved,
// no need to visit the contents. // no need to visit the contents.
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
// Otherwise, keep visiting. // Otherwise, keep visiting.
ct.super_visit_with(self) ct.super_visit_with(self)

View File

@ -1147,7 +1147,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if !ty.has_opaque_types() { if !ty.has_opaque_types() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
if let ty::Alias(ty::Opaque, ..) = ty.kind() { if let ty::Alias(ty::Opaque, ..) = ty.kind() {

View File

@ -26,7 +26,7 @@ pub fn type_visitable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
__visitor: &mut __V __visitor: &mut __V
) -> ::std::ops::ControlFlow<__V::BreakTy> { ) -> ::std::ops::ControlFlow<__V::BreakTy> {
match *self { #body_visit } match *self { #body_visit }
::std::ops::ControlFlow::CONTINUE ::std::ops::ControlFlow::Continue(())
} }
}, },
) )

View File

@ -93,7 +93,7 @@ macro_rules! TrivialTypeTraversalImpls {
_: &mut F) _: &mut F)
-> ::std::ops::ControlFlow<F::BreakTy> -> ::std::ops::ControlFlow<F::BreakTy>
{ {
::std::ops::ControlFlow::CONTINUE ::std::ops::ControlFlow::Continue(())
} }
} }
)+ )+
@ -219,7 +219,7 @@ macro_rules! EnumTypeTraversalImpl {
$($crate::ty::visit::TypeVisitable::visit_with( $($crate::ty::visit::TypeVisitable::visit_with(
$variant_arg, $visitor $variant_arg, $visitor
)?;)* )?;)*
::std::ops::ControlFlow::CONTINUE ::std::ops::ControlFlow::Continue(())
} }
$($output)* $($output)*
) )
@ -237,7 +237,7 @@ macro_rules! EnumTypeTraversalImpl {
$($crate::ty::visit::TypeVisitable::visit_with( $($crate::ty::visit::TypeVisitable::visit_with(
$variant_arg, $visitor $variant_arg, $visitor
)?;)* )?;)*
::std::ops::ControlFlow::CONTINUE ::std::ops::ControlFlow::Continue(())
} }
$($output)* $($output)*
) )
@ -251,7 +251,7 @@ macro_rules! EnumTypeTraversalImpl {
@VisitVariants($this, $visitor) @VisitVariants($this, $visitor)
input($($input)*) input($($input)*)
output( output(
$variant => { ::std::ops::ControlFlow::CONTINUE } $variant => { ::std::ops::ControlFlow::Continue(()) }
$($output)* $($output)*
) )
) )

View File

@ -4,6 +4,6 @@ use super::*;
impl<'tcx, R: Idx, C: Idx> TypeVisitable<'tcx> for BitMatrix<R, C> { impl<'tcx, R: Idx, C: Idx> TypeVisitable<'tcx> for BitMatrix<R, C> {
fn visit_with<V: TypeVisitor<'tcx>>(&self, _: &mut V) -> ControlFlow<V::BreakTy> { fn visit_with<V: TypeVisitor<'tcx>>(&self, _: &mut V) -> ControlFlow<V::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -2481,7 +2481,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
if not_previously_inserted { if not_previously_inserted {
ty.super_visit_with(self) ty.super_visit_with(self)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }

View File

@ -367,7 +367,7 @@ impl<'tcx> TypeFoldable<'tcx> for ty::AdtDef<'tcx> {
impl<'tcx> TypeVisitable<'tcx> for ty::AdtDef<'tcx> { impl<'tcx> TypeVisitable<'tcx> for ty::AdtDef<'tcx> {
fn visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> { fn visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -714,7 +714,7 @@ impl<'tcx> TypeSuperVisitable<'tcx> for Ty<'tcx> {
| ty::Placeholder(..) | ty::Placeholder(..)
| ty::Param(..) | ty::Param(..)
| ty::Never | ty::Never
| ty::Foreign(..) => ControlFlow::CONTINUE, | ty::Foreign(..) => ControlFlow::Continue(()),
} }
} }
} }
@ -742,7 +742,7 @@ impl<'tcx> TypeSuperFoldable<'tcx> for ty::Region<'tcx> {
impl<'tcx> TypeSuperVisitable<'tcx> for ty::Region<'tcx> { impl<'tcx> TypeSuperVisitable<'tcx> for ty::Region<'tcx> {
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> { fn super_visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -844,7 +844,7 @@ impl<'tcx> TypeFoldable<'tcx> for InferConst<'tcx> {
impl<'tcx> TypeVisitable<'tcx> for InferConst<'tcx> { impl<'tcx> TypeVisitable<'tcx> for InferConst<'tcx> {
fn visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> { fn visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> ControlFlow<V::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -2015,7 +2015,7 @@ impl<'tcx> Ty<'tcx> {
type BreakTy = (); type BreakTy = ();
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if self.0 == t { ControlFlow::BREAK } else { t.super_visit_with(self) } if self.0 == t { ControlFlow::Break(()) } else { t.super_visit_with(self) }
} }
} }

View File

@ -294,13 +294,13 @@ impl<'tcx> TyCtxt<'tcx> {
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
match *r { match *r {
ty::ReLateBound(debruijn, _) if debruijn < self.outer_index => { ty::ReLateBound(debruijn, _) if debruijn < self.outer_index => {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => { _ => {
if (self.callback)(r) { if (self.callback)(r) {
ControlFlow::BREAK ControlFlow::Break(())
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -311,7 +311,7 @@ impl<'tcx> TyCtxt<'tcx> {
if ty.flags().intersects(TypeFlags::HAS_FREE_REGIONS) { if ty.flags().intersects(TypeFlags::HAS_FREE_REGIONS) {
ty.super_visit_with(self) ty.super_visit_with(self)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -394,7 +394,7 @@ impl<'tcx> TypeVisitor<'tcx> for ValidateBoundVars<'tcx> {
if t.outer_exclusive_binder() < self.binder_index if t.outer_exclusive_binder() < self.binder_index
|| !self.visited.insert((self.binder_index, t)) || !self.visited.insert((self.binder_index, t))
{ {
return ControlFlow::BREAK; return ControlFlow::Break(());
} }
match *t.kind() { match *t.kind() {
ty::Bound(debruijn, bound_ty) if debruijn == self.binder_index => { ty::Bound(debruijn, bound_ty) if debruijn == self.binder_index => {
@ -512,7 +512,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
if t.outer_exclusive_binder() > self.outer_index { if t.outer_exclusive_binder() > self.outer_index {
ControlFlow::Break(FoundEscapingVars) ControlFlow::Break(FoundEscapingVars)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -524,7 +524,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
if r.bound_at_or_above_binder(self.outer_index) { if r.bound_at_or_above_binder(self.outer_index) {
ControlFlow::Break(FoundEscapingVars) ControlFlow::Break(FoundEscapingVars)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -547,7 +547,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
if predicate.outer_exclusive_binder() > self.outer_index { if predicate.outer_exclusive_binder() > self.outer_index {
ControlFlow::Break(FoundEscapingVars) ControlFlow::Break(FoundEscapingVars)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -575,7 +575,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
if flags.intersects(self.flags) { if flags.intersects(self.flags) {
ControlFlow::Break(FoundFlags) ControlFlow::Break(FoundFlags)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -585,7 +585,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
if flags.intersects(self.flags) { if flags.intersects(self.flags) {
ControlFlow::Break(FoundFlags) ControlFlow::Break(FoundFlags)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -596,7 +596,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
if flags.intersects(self.flags) { if flags.intersects(self.flags) {
ControlFlow::Break(FoundFlags) ControlFlow::Break(FoundFlags)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -605,7 +605,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
if predicate.flags().intersects(self.flags) { if predicate.flags().intersects(self.flags) {
ControlFlow::Break(FoundFlags) ControlFlow::Break(FoundFlags)
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -653,7 +653,7 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
// in the normalized form // in the normalized form
if self.just_constrained { if self.just_constrained {
if let ty::Alias(..) = t.kind() { if let ty::Alias(..) = t.kind() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
} }
@ -666,7 +666,7 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
// in the normalized form // in the normalized form
if self.just_constrained { if self.just_constrained {
if let ty::ConstKind::Unevaluated(..) = c.kind() { if let ty::ConstKind::Unevaluated(..) = c.kind() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
} }
@ -679,7 +679,7 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
self.regions.insert(br.kind); self.regions.insert(br.kind);
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -726,6 +726,6 @@ impl<'tcx> TypeVisitor<'tcx> for MaxUniverse {
); );
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -118,7 +118,7 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> {
// A diverging InlineAsm is treated as non-recursing // A diverging InlineAsm is treated as non-recursing
TerminatorKind::InlineAsm { destination, .. } => { TerminatorKind::InlineAsm { destination, .. } => {
if destination.is_some() { if destination.is_some() {
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
ControlFlow::Break(NonRecursive) ControlFlow::Break(NonRecursive)
} }
@ -132,7 +132,7 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> {
| TerminatorKind::FalseEdge { .. } | TerminatorKind::FalseEdge { .. }
| TerminatorKind::FalseUnwind { .. } | TerminatorKind::FalseUnwind { .. }
| TerminatorKind::Goto { .. } | TerminatorKind::Goto { .. }
| TerminatorKind::SwitchInt { .. } => ControlFlow::CONTINUE, | TerminatorKind::SwitchInt { .. } => ControlFlow::Continue(()),
} }
} }
@ -145,7 +145,7 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> {
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn ignore_edge(&mut self, bb: BasicBlock, target: BasicBlock) -> bool { fn ignore_edge(&mut self, bb: BasicBlock, target: BasicBlock) -> bool {

View File

@ -300,20 +300,20 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
#[instrument(level = "debug", skip(self))] #[instrument(level = "debug", skip(self))]
fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> {
if !c.has_non_region_param() { if !c.has_non_region_param() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
match c.kind() { match c.kind() {
ty::ConstKind::Param(param) => { ty::ConstKind::Param(param) => {
debug!(?param); debug!(?param);
self.unused_parameters.mark_used(param.index); self.unused_parameters.mark_used(param.index);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
ty::ConstKind::Unevaluated(ty::UnevaluatedConst { def, substs }) ty::ConstKind::Unevaluated(ty::UnevaluatedConst { def, substs })
if matches!(self.tcx.def_kind(def.did), DefKind::AnonConst) => if matches!(self.tcx.def_kind(def.did), DefKind::AnonConst) =>
{ {
self.visit_child_body(def.did, substs); self.visit_child_body(def.did, substs);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => c.super_visit_with(self), _ => c.super_visit_with(self),
} }
@ -322,7 +322,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
#[instrument(level = "debug", skip(self))] #[instrument(level = "debug", skip(self))]
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
if !ty.has_non_region_param() { if !ty.has_non_region_param() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
match *ty.kind() { match *ty.kind() {
@ -330,18 +330,18 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
debug!(?def_id); debug!(?def_id);
// Avoid cycle errors with generators. // Avoid cycle errors with generators.
if def_id == self.def_id { if def_id == self.def_id {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
// Consider any generic parameters used by any closures/generators as used in the // Consider any generic parameters used by any closures/generators as used in the
// parent. // parent.
self.visit_child_body(def_id, substs); self.visit_child_body(def_id, substs);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
ty::Param(param) => { ty::Param(param) => {
debug!(?param); debug!(?param);
self.unused_parameters.mark_used(param.index); self.unused_parameters.mark_used(param.index);
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => ty.super_visit_with(self), _ => ty.super_visit_with(self),
} }

View File

@ -112,7 +112,11 @@ where
fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<V::BreakTy> { fn visit_trait(&mut self, trait_ref: TraitRef<'tcx>) -> ControlFlow<V::BreakTy> {
let TraitRef { def_id, substs, .. } = trait_ref; let TraitRef { def_id, substs, .. } = trait_ref;
self.def_id_visitor.visit_def_id(def_id, "trait", &trait_ref.print_only_trait_path())?; self.def_id_visitor.visit_def_id(def_id, "trait", &trait_ref.print_only_trait_path())?;
if self.def_id_visitor.shallow() { ControlFlow::CONTINUE } else { substs.visit_with(self) } if self.def_id_visitor.shallow() {
ControlFlow::Continue(())
} else {
substs.visit_with(self)
}
} }
fn visit_projection_ty(&mut self, projection: ty::AliasTy<'tcx>) -> ControlFlow<V::BreakTy> { fn visit_projection_ty(&mut self, projection: ty::AliasTy<'tcx>) -> ControlFlow<V::BreakTy> {
@ -131,7 +135,7 @@ where
}; };
self.visit_trait(trait_ref)?; self.visit_trait(trait_ref)?;
if self.def_id_visitor.shallow() { if self.def_id_visitor.shallow() {
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
assoc_substs.iter().try_for_each(|subst| subst.visit_with(self)) assoc_substs.iter().try_for_each(|subst| subst.visit_with(self))
} }
@ -155,7 +159,7 @@ where
ty, ty,
_region, _region,
))) => ty.visit_with(self), ))) => ty.visit_with(self),
ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..)) => ControlFlow::CONTINUE, ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..)) => ControlFlow::Continue(()),
ty::PredicateKind::ConstEvaluatable(ct) => ct.visit_with(self), ty::PredicateKind::ConstEvaluatable(ct) => ct.visit_with(self),
ty::PredicateKind::WellFormed(arg) => arg.visit_with(self), ty::PredicateKind::WellFormed(arg) => arg.visit_with(self),
_ => bug!("unexpected predicate: {:?}", predicate), _ => bug!("unexpected predicate: {:?}", predicate),
@ -189,7 +193,7 @@ where
| ty::Generator(def_id, ..) => { | ty::Generator(def_id, ..) => {
self.def_id_visitor.visit_def_id(def_id, "type", &ty)?; self.def_id_visitor.visit_def_id(def_id, "type", &ty)?;
if self.def_id_visitor.shallow() { if self.def_id_visitor.shallow() {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
// Default type visitor doesn't visit signatures of fn types. // Default type visitor doesn't visit signatures of fn types.
// Something like `fn() -> Priv {my_func}` is considered a private type even if // Something like `fn() -> Priv {my_func}` is considered a private type even if
@ -214,7 +218,7 @@ where
// as visible/reachable even if both `Type` and `Trait` are private. // as visible/reachable even if both `Type` and `Trait` are private.
// Ideally, associated types should be substituted in the same way as // Ideally, associated types should be substituted in the same way as
// free type aliases, but this isn't done yet. // free type aliases, but this isn't done yet.
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
// This will also visit substs if necessary, so we don't need to recurse. // This will also visit substs if necessary, so we don't need to recurse.
return self.visit_projection_ty(proj); return self.visit_projection_ty(proj);
@ -274,7 +278,7 @@ where
} }
if self.def_id_visitor.shallow() { if self.def_id_visitor.shallow() {
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
ty.super_visit_with(self) ty.super_visit_with(self)
} }
@ -319,7 +323,7 @@ impl<'a, 'tcx, VL: VisibilityLike> DefIdVisitor<'tcx> for FindMin<'a, 'tcx, VL>
if let Some(def_id) = def_id.as_local() { if let Some(def_id) = def_id.as_local() {
self.min = VL::new_min(self, def_id); self.min = VL::new_min(self, def_id);
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -881,7 +885,7 @@ impl<'tcx> DefIdVisitor<'tcx> for ReachEverythingInTheInterfaceVisitor<'_, 'tcx>
self.ev.update(def_id, self.level); self.ev.update(def_id, self.level);
} }
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
@ -1368,9 +1372,9 @@ impl<'tcx> DefIdVisitor<'tcx> for TypePrivacyVisitor<'tcx> {
descr: &dyn fmt::Display, descr: &dyn fmt::Display,
) -> ControlFlow<Self::BreakTy> { ) -> ControlFlow<Self::BreakTy> {
if self.check_def_id(def_id, kind, descr) { if self.check_def_id(def_id, kind, descr) {
ControlFlow::BREAK ControlFlow::Break(())
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }
@ -1865,9 +1869,9 @@ impl<'tcx> DefIdVisitor<'tcx> for SearchInterfaceForPrivateItemsVisitor<'tcx> {
descr: &dyn fmt::Display, descr: &dyn fmt::Display,
) -> ControlFlow<Self::BreakTy> { ) -> ControlFlow<Self::BreakTy> {
if self.check_def_id(def_id, kind, descr) { if self.check_def_id(def_id, kind, descr) {
ControlFlow::BREAK ControlFlow::Break(())
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }

View File

@ -614,12 +614,12 @@ impl<'tcx> OrphanChecker<'tcx> {
fn found_non_local_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<OrphanCheckEarlyExit<'tcx>> { fn found_non_local_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<OrphanCheckEarlyExit<'tcx>> {
self.non_local_tys.push((t, self.in_self_ty)); self.non_local_tys.push((t, self.in_self_ty));
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn found_param_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<OrphanCheckEarlyExit<'tcx>> { fn found_param_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<OrphanCheckEarlyExit<'tcx>> {
if self.search_first_local_ty { if self.search_first_local_ty {
ControlFlow::CONTINUE ControlFlow::Continue(())
} else { } else {
ControlFlow::Break(OrphanCheckEarlyExit::ParamTy(t)) ControlFlow::Break(OrphanCheckEarlyExit::ParamTy(t))
} }
@ -641,7 +641,7 @@ enum OrphanCheckEarlyExit<'tcx> {
impl<'tcx> TypeVisitor<'tcx> for OrphanChecker<'tcx> { impl<'tcx> TypeVisitor<'tcx> for OrphanChecker<'tcx> {
type BreakTy = OrphanCheckEarlyExit<'tcx>; type BreakTy = OrphanCheckEarlyExit<'tcx>;
fn visit_region(&mut self, _r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_region(&mut self, _r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
@ -756,6 +756,6 @@ impl<'tcx> TypeVisitor<'tcx> for OrphanChecker<'tcx> {
/// parameters, allowing uncovered const parameters in impls seems more useful /// parameters, allowing uncovered const parameters in impls seems more useful
/// than allowing `impl<T> Trait<local_fn_ptr, T> for i32` to compile. /// than allowing `impl<T> Trait<local_fn_ptr, T> for i32` to compile.
fn visit_const(&mut self, _c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_const(&mut self, _c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }

View File

@ -198,7 +198,7 @@ fn satisfied_from_param_env<'tcx>(
// If we start allowing directly writing `ConstKind::Expr` without an intermediate anon const // If we start allowing directly writing `ConstKind::Expr` without an intermediate anon const
// this will be incorrect. It might be worth investigating making `predicates_of` elaborate // this will be incorrect. It might be worth investigating making `predicates_of` elaborate
// all of the `ConstEvaluatable` bounds rather than having a visitor here. // all of the `ConstEvaluatable` bounds rather than having a visitor here.
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }

View File

@ -2932,7 +2932,7 @@ impl<'tcx> ty::TypeVisitor<'tcx> for HasNumericInferVisitor {
if matches!(ty.kind(), ty::Infer(ty::FloatVar(_) | ty::IntVar(_))) { if matches!(ty.kind(), ty::Infer(ty::FloatVar(_) | ty::IntVar(_))) {
ControlFlow::Break(()) ControlFlow::Break(())
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
} }

View File

@ -493,7 +493,7 @@ fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefI
&& let param_def_id = self.generics.type_param(param, self.tcx).def_id && let param_def_id = self.generics.type_param(param, self.tcx).def_id
&& self.tcx.parent(param_def_id) == self.trait_item_def_id && self.tcx.parent(param_def_id) == self.trait_item_def_id
{ {
return ControlFlow::BREAK; return ControlFlow::Break(());
} }
t.super_visit_with(self) t.super_visit_with(self)
} }
@ -502,7 +502,7 @@ fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefI
&& let param_def_id = self.generics.region_param(&param, self.tcx).def_id && let param_def_id = self.generics.region_param(&param, self.tcx).def_id
&& self.tcx.parent(param_def_id) == self.trait_item_def_id && self.tcx.parent(param_def_id) == self.trait_item_def_id
{ {
return ControlFlow::BREAK; return ControlFlow::Break(());
} }
r.super_visit_with(self) r.super_visit_with(self)
} }
@ -511,7 +511,7 @@ fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefI
&& let param_def_id = self.generics.const_param(&param, self.tcx).def_id && let param_def_id = self.generics.const_param(&param, self.tcx).def_id
&& self.tcx.parent(param_def_id) == self.trait_item_def_id && self.tcx.parent(param_def_id) == self.trait_item_def_id
{ {
return ControlFlow::BREAK; return ControlFlow::Break(());
} }
ct.super_visit_with(self) ct.super_visit_with(self)
} }

View File

@ -783,16 +783,16 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeVisitable<'tcx>>(
match t.kind() { match t.kind() {
ty::Param(_) => { ty::Param(_) => {
if t == self.tcx.types.self_param { if t == self.tcx.types.self_param {
ControlFlow::BREAK ControlFlow::Break(())
} else { } else {
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
} }
ty::Alias(ty::Projection, ref data) ty::Alias(ty::Projection, ref data)
if self.tcx.def_kind(data.def_id) == DefKind::ImplTraitPlaceholder => if self.tcx.def_kind(data.def_id) == DefKind::ImplTraitPlaceholder =>
{ {
// We'll deny these later in their own pass // We'll deny these later in their own pass
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
ty::Alias(ty::Projection, ref data) => { ty::Alias(ty::Projection, ref data) => {
// This is a projected type `<Foo as SomeTrait>::X`. // This is a projected type `<Foo as SomeTrait>::X`.
@ -820,7 +820,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeVisitable<'tcx>>(
.contains(&data.trait_ref(self.tcx).def_id); .contains(&data.trait_ref(self.tcx).def_id);
if is_supertrait_of_current_trait { if is_supertrait_of_current_trait {
ControlFlow::CONTINUE // do not walk contained types, do not report error, do collect $200 ControlFlow::Continue(()) // do not walk contained types, do not report error, do collect $200
} else { } else {
t.super_visit_with(self) // DO walk contained types, POSSIBLY reporting an error t.super_visit_with(self) // DO walk contained types, POSSIBLY reporting an error
} }

View File

@ -133,7 +133,7 @@ impl<'tcx> TypeVisitor<'tcx> for MaxEscapingBoundVarVisitor {
.escaping .escaping
.max(t.outer_exclusive_binder().as_usize() - self.outer_index.as_usize()); .max(t.outer_exclusive_binder().as_usize() - self.outer_index.as_usize());
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
#[inline] #[inline]
@ -145,7 +145,7 @@ impl<'tcx> TypeVisitor<'tcx> for MaxEscapingBoundVarVisitor {
} }
_ => {} _ => {}
} }
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
fn visit_const(&mut self, ct: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> { fn visit_const(&mut self, ct: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {
@ -153,7 +153,7 @@ impl<'tcx> TypeVisitor<'tcx> for MaxEscapingBoundVarVisitor {
ty::ConstKind::Bound(debruijn, _) if debruijn >= self.outer_index => { ty::ConstKind::Bound(debruijn, _) if debruijn >= self.outer_index => {
self.escaping = self.escaping =
self.escaping.max(debruijn.as_usize() - self.outer_index.as_usize()); self.escaping.max(debruijn.as_usize() - self.outer_index.as_usize());
ControlFlow::CONTINUE ControlFlow::Continue(())
} }
_ => ct.super_visit_with(self), _ => ct.super_visit_with(self),
} }

View File

@ -107,25 +107,25 @@ impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
ty::FnDef(..) => { ty::FnDef(..) => {
// Types of formals and return in `fn(_) -> _` are also irrelevant; // Types of formals and return in `fn(_) -> _` are also irrelevant;
// so we do not recur into them via `super_visit_with` // so we do not recur into them via `super_visit_with`
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
ty::Array(_, n) ty::Array(_, n)
if { n.try_eval_usize(self.tcx, ty::ParamEnv::reveal_all()) == Some(0) } => if { n.try_eval_usize(self.tcx, ty::ParamEnv::reveal_all()) == Some(0) } =>
{ {
// rust-lang/rust#62336: ignore type of contents // rust-lang/rust#62336: ignore type of contents
// for empty array. // for empty array.
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Str | ty::Never => { ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Str | ty::Never => {
// These primitive types are always structural match. // These primitive types are always structural match.
// //
// `Never` is kind of special here, but as it is not inhabitable, this should be fine. // `Never` is kind of special here, but as it is not inhabitable, this should be fine.
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
ty::FnPtr(..) => { ty::FnPtr(..) => {
if !self.adt_const_param { if !self.adt_const_param {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} else { } else {
return ControlFlow::Break(ty); return ControlFlow::Break(ty);
} }
@ -147,7 +147,7 @@ impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
// Even though `NonStructural` does not implement `PartialEq`, // Even though `NonStructural` does not implement `PartialEq`,
// structural equality on `T` does not recur into the raw // structural equality on `T` does not recur into the raw
// pointer. Therefore, one can still use `C` in a pattern. // pointer. Therefore, one can still use `C` in a pattern.
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} else { } else {
return ControlFlow::Break(ty); return ControlFlow::Break(ty);
} }
@ -155,7 +155,7 @@ impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
ty::Float(_) => { ty::Float(_) => {
if !self.adt_const_param { if !self.adt_const_param {
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} else { } else {
return ControlFlow::Break(ty); return ControlFlow::Break(ty);
} }
@ -172,13 +172,13 @@ impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
self.tcx.sess.delay_span_bug(self.span, "ty::Error in structural-match check"); self.tcx.sess.delay_span_bug(self.span, "ty::Error in structural-match check");
// We still want to check other types after encountering an error, // We still want to check other types after encountering an error,
// as this may still emit relevant errors. // as this may still emit relevant errors.
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
}; };
if !self.seen.insert(adt_def.did()) { if !self.seen.insert(adt_def.did()) {
debug!("Search already seen adt_def: {:?}", adt_def); debug!("Search already seen adt_def: {:?}", adt_def);
return ControlFlow::CONTINUE; return ControlFlow::Continue(());
} }
if !self.type_marked_structural(ty) { if !self.type_marked_structural(ty) {