Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cycle error building rustc with debug logging #61577

Open
ehuss opened this issue Jun 6, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@ehuss
Copy link
Contributor

commented Jun 6, 2019

When using RUSTC_LOG to debug building rustc itself, I ran into this error:

error[E0391]: cycle detected when processing `hir::def::<impl at src/librustc/hir/def.rs:255:1: 270:2>::present_items::{{opaque}}#0`
   --> src/librustc/hir/def.rs:262:35
    |
262 |     pub fn present_items(self) -> impl Iterator<Item=T> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^
    |                                   |
    |                                   in this expansion of `desugaring of `existential type``
    |                                   in this macro invocation
    |
note: ...which requires processing `hir::def::<impl at src/librustc/hir/def.rs:255:1: 270:2>::present_items::{{opaque}}#0`...
   --> src/librustc/hir/def.rs:262:35
    |
262 |     pub fn present_items(self) -> impl Iterator<Item=T> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^
    |                                   |
    |                                   in this expansion of `desugaring of `existential type``
    |                                   in this macro invocation
note: ...which requires processing `hir::def::<impl at src/librustc/hir/def.rs:255:1: 270:2>::present_items::{{opaque}}#0`...
   --> src/librustc/hir/def.rs:262:35
    |
262 |     pub fn present_items(self) -> impl Iterator<Item=T> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^
    |                                   |
    |                                   in this expansion of `desugaring of `existential type``
    |                                   in this macro invocation
    = note: ...which again requires processing `hir::def::<impl at src/librustc/hir/def.rs:255:1: 270:2>::present_items::{{opaque}}#0`, completing the cycle
note: cycle used when processing `hir::def::<impl at src/librustc/hir/def.rs:255:1: 270:2>::present_items`
   --> src/librustc/hir/def.rs:262:5
    |
262 |     pub fn present_items(self) -> impl Iterator<Item=T> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Repro:

  1. Set debug = true in config.toml.
  2. ./x.py build to get a debug compiler (and go through several steps in stage 1 we want to skip).
  3. touch src/librustc/lib.rs
  4. RUSTC_LOG=rustc::ty=debug ./x.py build --stage=1 --keep-stage=0 > dlog 2>&1

The last step should rebuild librustc using a compiler with debugging enabled. I imagine there is a faster way to do this, but these are the simplest instructions I could think of.

Is this known/expected? I have no idea what the error means, but it makes debugging more difficult.

Currently on master (7cdaffd).

@jonas-schievink

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

Ran into the same problem while investigating #60414 (comment), very annoying indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.