-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Hang in trait solver with mutually recursive trait bounds #150532
Copy link
Copy link
Closed as duplicate of#142863
Closed as duplicate of#142863
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.
Description
Activity
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.
I tried this code:
I expected to see this happen: The compiler should detect the cyclic dependency or hit the recursion limit, resulting in a compilation error (e.g., error: overflow evaluating the requirement).
Instead, this happened: The compiler hangs indefinitely (tested for > 5 minutes) ,indicating an infinite loop in the trait solver (likely struggling with the generic inference in the recursive bounds).
Meta
rustc --version --verbose:Backtrace
N/A (The compiler hangs indefinitely, so no panic backtrace is produced.)