Skip to content

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

Description

@elimayano

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>

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 5, 2026
  2. cyrgani commented on Feb 5, 2026

    @cyrgani
    Contributor

    smaller:

    trait Foo {}
    impl<T> Foo for T where (Undefined, T): Foo {}
    impl<T, W: Foo> Foo for (T, W) {}
    fn main() {}
  3. added
    I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 5, 2026
  4. Human9000-bit commented on Feb 6, 2026

    @Human9000-bit
    Member

    maybe maybe maybe

    @rustbot claim

  5. Human9000-bit commented on Apr 11, 2026

    @Human9000-bit
    Member

    @rustbot release-assignment

  6. janis-bhm commented on Aug 12, 2026

    @janis-bhm
    Contributor

    This no longer hangs for me on rustc 1.99.0-nightly (3d6c19bb9 2026-08-11), but does on the latest stable version.

  7. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions