From 55e0a348c7d948fa026007d8358338272e39f651 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 26 Sep 2025 08:22:02 -0400 Subject: [PATCH 1/2] Make the inliner recursion depth hack stronger --- compiler/rustc_mir_transform/src/inline/cycle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs index 25a9baffe582d..8b49ea3f8a217 100644 --- a/compiler/rustc_mir_transform/src/inline/cycle.rs +++ b/compiler/rustc_mir_transform/src/inline/cycle.rs @@ -162,9 +162,9 @@ pub(crate) fn mir_callgraph_cyclic<'tcx>( // grows as we recurse into the call graph. If we use the same recursion limit here and in the // solver, the solver hits the limit first and emits a fatal error. But if we use a reduced // limit, we will hit the limit first and give up on looking for inlining. And in any case, - // the default recursion limits are quite generous for us. If we need to recurse 64 times + // the default recursion limits are quite generous for us. If we need to recurse 16 times // into the call graph, we're probably not going to find any useful MIR inlining. - let recursion_limit = tcx.recursion_limit() / 2; + let recursion_limit = tcx.recursion_limit() / 8; let mut involved = FxHashSet::default(); let typing_env = ty::TypingEnv::post_analysis(tcx, root); let root_instance = From 9e379ff1a6458393a9ff81e63bd008c5fb9d0190 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 26 Sep 2025 16:16:13 -0400 Subject: [PATCH 2/2] Remove crashes test that doesn't crash but wasn't fixed --- tests/crashes/131342.rs | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 tests/crashes/131342.rs diff --git a/tests/crashes/131342.rs b/tests/crashes/131342.rs deleted file mode 100644 index f4404092917a4..0000000000000 --- a/tests/crashes/131342.rs +++ /dev/null @@ -1,15 +0,0 @@ -//@ known-bug: #131342 - -fn main() { - let mut items = vec![1, 2, 3, 4, 5].into_iter(); - problem_thingy(&mut items); -} - -fn problem_thingy(items: &mut impl Iterator) { - let mut peeker = items.peekable(); - match peeker.peek() { - Some(_) => (), - None => return (), - } - problem_thingy(&mut peeker); -}