rust-lang / rust-lang/rust

rustc hangs in trait solver due to infinite recursion in generic tuple implementation

Open
#152,169 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug E-needs-bisection I-hang S-has-mcve T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this code:

trait MutableBinding {}
impl<T> MutableBinding for T
where
    (W, T, W, T): MutableBinding,
{}
impl<
    T: ,
    U: ,
    V: ,
    W: MutableBinding,
> MutableBinding for (T, U, V, W) {}
fn main(){}



I expected to see this happen: The compiler should report an error (e.g. recursion limit reached or undefined type W) instead of hanging.

Instead, this happened: The compiler enters an infinite loop (hangs) during trait resolution . both in next solver and new solver.

Meta

rustc --version --verbose:

rustc 1.93.0 (254b59607 2026-01-19)
binary: rustc
commit-hash: 254b59607d4417e9dffbc307138ae5c86280fe4c
commit-date: 2026-01-19
host: x86_64-unknown-linux-gnu
release: 1.93.0
LLVM version: 21.1.8
Backtrace

<backtrace>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the supplied reproducer with rustc 1.93.0 and tracing the trait-resolution path in both the next and new solvers, where the report says the hang occurs. Done means the compiler terminates with a diagnostic such as a recursion-limit or undefined-type error rather than looping.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.