Skip to content

Commit 0ec7cf7

Browse files
committed
Auto merge of #147062 - saethlin:geoarrow-inliner-recursion-hack, r=petrochenkov
Make the inliner recursion depth hack stronger We previously tried to introduce a more gentle version of this hack in github.com//pull/129714, but that wasn't enough because the problem was re-reported in #131960 (comment). So this increases the magic number from 2 to 8. Surely nobody will complain that they have a type whose depth grows more than 8 times faster than its call graph depth.
2 parents 29b7717 + 9e379ff commit 0ec7cf7

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

compiler/rustc_mir_transform/src/inline/cycle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ pub(crate) fn mir_callgraph_cyclic<'tcx>(
162162
// grows as we recurse into the call graph. If we use the same recursion limit here and in the
163163
// solver, the solver hits the limit first and emits a fatal error. But if we use a reduced
164164
// limit, we will hit the limit first and give up on looking for inlining. And in any case,
165-
// the default recursion limits are quite generous for us. If we need to recurse 64 times
165+
// the default recursion limits are quite generous for us. If we need to recurse 16 times
166166
// into the call graph, we're probably not going to find any useful MIR inlining.
167-
let recursion_limit = tcx.recursion_limit() / 2;
167+
let recursion_limit = tcx.recursion_limit() / 8;
168168
let mut involved = FxHashSet::default();
169169
let typing_env = ty::TypingEnv::post_analysis(tcx, root);
170170
let root_instance =

tests/crashes/131342.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)