Skip to content

Adds recursion limit into FindParamInClause#152800

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
spirali:fix-FindParamInClause
Mar 9, 2026
Merged

Adds recursion limit into FindParamInClause#152800
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
spirali:fix-FindParamInClause

Conversation

@spirali
Copy link
Contributor

@spirali spirali commented Feb 18, 2026

Fixes #152716

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 18, 2026
@rustbot

This comment was marked as outdated.

@rustbot rustbot assigned lcnr and unassigned fmease Feb 18, 2026
ty.super_visit_with(self)
self.recursion_depth += 1;
if self.recursion_depth > self.ecx.cx().recursion_limit() {
return ControlFlow::Break(Err(NoSolution));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means that we don't consider this where-bound at all, but we should consider it, just as overflow. Change the type Result to be an Result<Certainty, NoSolution> and propagate the certainty back up (conservatively treating where-bounds which overflow as non-global)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -0,0 +1,17 @@
//@ compile-flags: -Znext-solver

// Regression test for <https://github.com/rust-lang/rust/issues/152716>.
Copy link
Contributor

@lcnr lcnr Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a line or two explaining what this is testing/why it was wrong before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment

I: Interner,
{
type Result = ControlFlow<Result<(), NoSolution>>;
type Result = ControlFlow<Result<Certainty, NoSolution>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment to this type explaining what the different values mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment

@spirali spirali force-pushed the fix-FindParamInClause branch from 17ee9a9 to fab2e8e Compare March 7, 2026 20:13
@rust-log-analyzer

This comment has been minimized.

@spirali spirali force-pushed the fix-FindParamInClause branch from fab2e8e to 592246e Compare March 7, 2026 21:09
@lcnr
Copy link
Contributor

lcnr commented Mar 9, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 9, 2026

📌 Commit 592246e has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 9, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #152847 (Test for armv7 `get_unchecked(...)` inlining)
 - #153290 (tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size)
 - #153413 (std: organise `sys::pal::os`)
 - #139692 (Rustfmt now support use closures)
 - #152800 (Adds recursion limit into FindParamInClause)
 - #153244 (tools: remote-test-server: Add UEFI run support)
 - #153305 (Adapt codegen test to accept operand bundles)
 - #153340 (tweak r-a default settings)
 - #153509 (Cleanup unused diagnostic emission methods - part 2)
 - #153527 (Fix LegacyKeyValueFormat report from docker build: ohos)
 - #153594 (Move some ui tests)
@rust-bors rust-bors bot merged commit fad370c into rust-lang:main Mar 9, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 9, 2026
rust-timer added a commit that referenced this pull request Mar 9, 2026
Rollup merge of #152800 - spirali:fix-FindParamInClause, r=lcnr

Adds recursion limit into FindParamInClause

Fixes #152716

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FindParamInClause visitor can stack overflow

5 participants