Repository navigation
Hang: Compiler hang in resolving Matrix<(), > with GATs [next-solver] #151503
Copy link
Copy link
Open
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)
Activity
ionicmc-rs commentedon Jan 22, 2026
Code in the playground
ionicmc-rs commentedon Jan 22, 2026
Rust analyzer (with nightly) gives a regular error here (hangs after a few checks)
cyrgani commentedon Jan 22, 2026
slightly smaller:
lcnr commentedon Oct 8, 2026
this now compiles quickly.
should figure out which PR fixed this, and then add a test.
zakrad commentedon Oct 13, 2026
@rustbot claim
Rollup merge of rust-lang#164287 - zakrad:regr-test-151503, r=adwinwhite