Skip to content

'rustc' panicked at 'forcing query with already existing DepNode #8357

@timbru

Description

@timbru

Hi,

We run cargo clippy --all --all-features -- -D warnings using Github actions for our project and it started failing with a compiler panic. I have the same issues if I run this on my Mac mini M1. If I just run cargo clippy --all --all-features it works, and I get no warnings.

This seems to have been triggered by this commit:
NLnetLabs/rpki-rs@67c6b99

Output of the error from my machine:

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<R as std::io::BufRead>, polarity:Positive), []), Binder(TraitPredicate(<R as std::io::Read>, polarity:Positive), []), Binder(TraitPredicate(<R as std::marker::Sized>, polarity:Positive), [])], reveal: UserFacing }, value: Const { ty: xml::decode::Name, val: Value(ByRef { alloc: Allocation { bytes: [0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [(Size { raw: 0 }, alloc194), (Size { raw: 16 }, alloc153)] }), init_mask: InitMask { blocks: [4294967295], len: Size { raw: 32 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } }
- dep-node: destructure_const(dbbd680d64dbbc1d-1e554034797ecc7c)', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/compiler/rustc_query_system/src/dep_graph/graph.rs:236:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.58 (db9d1b20 2022-01-20)

query stack during panic:
#0 [destructure_const] destructure constant
#1 [check_match] match-checking `remote::publication::<impl at src/remote/publication.rs:552:1: 717:2>::decode::{closure#0}`
end of query stack
error: could not compile `rpki`

Activity

timbru

timbru commented on Jan 27, 2022

@timbru
Author

Update:

It also happened during a verbose build: cargo build --all-features --verbose.

I managed to work around the issue in this commit:
NLnetLabs/rpki-rs@021bbb3

It is somehow related to a match that I am doing using const values, when I changed this match here to use a const &[u8] instead of our own type things worked again:
https://github.com/NLnetLabs/rpki-rs/blob/021bbb3cb9db07332d7438883f30238f39ea37b6/src/remote/publication.rs#L607

Somehow it was still okay with other such occurrences.

In any case.. I have refactored my code and this is not in my way anymore. Leaving this here as it seems to point to some issue.

giraffate

giraffate commented on Jan 28, 2022

@giraffate
Contributor

Thanks for the report!

It's a duplicate of rust-lang/rust#89690, so I'm closing this.

deepu105

deepu105 commented on Aug 26, 2023

@deepu105

Seeing this again when running clippy in Rust 1.73, don't have it in 1.72

rust-lang/rust#83085 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @deepu105@timbru@giraffate

        Issue actions

          'rustc' panicked at 'forcing query with already existing `DepNode` · Issue #8357 · rust-lang/rust-clippy