Cycle error from pretty printer with RUST_LOG #59985
Labels
A-pretty
Area: Pretty printing (including `-Z unpretty`)
C-bug
Category: This is a bug.
I-cycle
Issue: A query cycle occurred while none was expected
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
(I wasn't able to find any existing discussion, issues or PRs about this, I'd not be surprised if someone had found it already, so my bad if this isn't a new problem)
Yesterday, I was about to take a look into #59494 (the test case for that will trigger this), running that test case with
RUST_LOG=rustc::traits
makes a cycle error happen instead of the expected ICE. I can get the ICE with justRUST_LOG=rustc::traits::select
(IIRC), but not when I include other modules.The cycle error comes from the pretty printer, in particular this line. I managed to resolve the issue, here's the diff that fixed it - when the pretty printer calls
predicates_of
for existential types then it ends up calling code with debug logs that print the same type, causing a cycle.The diff above only bypasses the cycle error when
RUST_LOG=rustc::ty::subst,rustc::ty::context,rustc_typeck
, I assume it won't when you add more modules. Here's the relevant Zulip topic.The text was updated successfully, but these errors were encountered: