From 04c453c4bc4de30b41e3bd3ee7492d37b2cc3d89 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 22 Feb 2025 23:54:08 +0000 Subject: [PATCH] Fix bugs due to unhandled ControlFlow --- compiler/rustc_lint/src/types.rs | 2 +- compiler/stable_mir/src/visitor.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 68b1f435a4c..3ec61cdf41a 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1587,7 +1587,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { } impl<'a, 'b, 'tcx> ty::visit::TypeVisitor> for FnPtrFinder<'a, 'b, 'tcx> { - type Result = ControlFlow>; + type Result = (); fn visit_ty(&mut self, ty: Ty<'tcx>) -> Self::Result { if let ty::FnPtr(_, hdr) = ty.kind() diff --git a/compiler/stable_mir/src/visitor.rs b/compiler/stable_mir/src/visitor.rs index 3533ed2e851..8463174f9a4 100644 --- a/compiler/stable_mir/src/visitor.rs +++ b/compiler/stable_mir/src/visitor.rs @@ -161,7 +161,7 @@ impl Visitable for RigidTy { RigidTy::Slice(inner) => inner.visit(visitor), RigidTy::RawPtr(ty, _) => ty.visit(visitor), RigidTy::Ref(reg, ty, _) => { - reg.visit(visitor); + reg.visit(visitor)?; ty.visit(visitor) } RigidTy::Adt(_, args)