circular set of associated types cause cargo build to hang #123448
Labels
A-traits
Area: Trait system
C-bug
Category: This is a bug.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have a linear algebra based project (https://github.com/martinjrobins/diffsol) which has a set of Scalar, Vector and Matrix traits that refer to each other via associated traits. On stable (rustc 1.77.1) this builds fine, but on beta (1.78.0) and nightly (1.79.0) the build hangs (martinjrobins/diffsol#3). A MRE is:
If I look at the compiler log with RUSTC_LOG=TRACE I see an endless repitition of text like:
Note that if I remove the
MatrixCommon
trait everything builds fine.Meta
The bug does not exist in stable:
rustup run stable rustc --version
:The bug exists in beta and nightly:
rustup run beta rustc --version
:rustup run nightly rustc --version
:Backtrace
here is some more of the logs:
The text was updated successfully, but these errors were encountered: