rust-lang / rust-lang/rust

Compiler hangs when adding a `Send` trait bound to an HRTB associated type

Open
#153,242 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug fixed-by-next-solver I-hang needs-triage T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this code:

trait X<'a>
{
    type U: ;  
}

impl X<'_> for u32 
where
    for<'b> <Self as X<'b>>::U: Clone + Send + ,
{
    type U = str;
}

fn main() {}

this hang does not occur if the -Z next-solver flag is used

Meta

rustc --version --verbose:

rustc 1.93.1 (01f6ddf75 2026-02-11)
binary: rustc
commit-hash: 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf
commit-date: 2026-02-11
host: x86_64-unknown-linux-gnu
release: 1.93.1
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 reproducer with rustc and compare its behavior with and without the -Z next-solver flag. No repository file or test is named, so trace the compiler path handling the HRTB associated-type bounds; done means the example no longer hangs and behavior is covered by a regression test.

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
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.