Skip to content

cycle error building rustc with debug logging #61577

Closed
@ehuss

Description

@ehuss

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-trait-systemArea: Trait systemC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions