Hang: Compiler hang in resolving Matrix<(), > with GATs [next-solver]
Open
Nobody has claimed this yet.
A-GATs
C-bug
I-hang
needs-triage
T-compiler
WG-trait-system-refactor
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:(auto-reduce)
trait HasAlias {}
struct Dummy;
trait DummyTrait {
type DummyType<T>;
}
impl DummyTrait for Dummy {
type DummyType<T> = T;
}
type AliasOf<T> = <Dummy as DummyTrait>::DummyType<T>;
struct Matrix<T, S>(T, S);
type OMatrix<T> = Matrix<T, AliasOf<T>>;
trait SimdValue {
type Element;
}
impl<T: HasAlias + SimdValue> SimdValue for OMatrix<T> {
type Element = OMatrix<T::Element>;
}
trait Unimplemented {}
trait MyFrom<T> {}
impl<T> MyFrom<T> for T {}
impl<T: SimdValue> MyFrom<T> for OMatrix<T::Element> {}
impl<T, S> HasAlias for Matrix<T, S> {}
impl Unimplemented for Matrix<()> {}
fn main() {}
The compiler hangs even with -Z next-solver=globally
| Release channel | Result |
|---|---|
| current Stable | error |
| current Nightly (default solver) | Hang |
Nightly + -Znext-solver=globally |
Hang |
Meta
rustc --version --verbose:
rustc 1.95.0-nightly (eda76d9d1 2026-01-21)
binary: rustc
commit-hash: eda76d9d1d133effbf7facb28168fd78d75fd434
commit-date: 2026-01-21
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8
Backtrace
Hangs.
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 compiling the reduced Rust example and compare the default solver with -Znext-solver=globally, confirming the hang on the reported nightly version. Trace the compiler's trait-solving path for the GAT alias, overlapping MyFrom implementations, and Matrix bounds; done means the reproducer terminates without introducing incorrect diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100