Hang in trait resolution with and without `-Znext-solver`
Open
Nobody has claimed this yet.
A-trait-system
C-bug
I-hang
T-types
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
//@compile-flags: -Znext-solver=globally
trait Foo {}
struct Bar<T>(T);
impl<T> Foo for T
where
Bar<T>: Foo,
{}
impl<T> Foo for Bar<T> {}
impl<T: Foo> Foo for Bar<T> {}
fn main(){}
Meta
rustc --version --verbose:
rustc 1.95.0-nightly (d222ddc4d 2026-01-23)
binary: rustc
commit-hash: d222ddc4d90743dfc1e53b610be8fc9d95893d2c
commit-date: 2026-01-23
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8
Backtrace
<backtrace>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Rust reproducer with rustc 1.95.0-nightly, comparing behavior with and without -Znext-solver=globally. Investigate the trait-resolution path involved in the hang; done means both modes terminate reliably for this example without hanging.
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
- Needs clarification
- Newbie friendliness
- 35/100