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

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

Closed
timbru opened this issue Jan 27, 2022 · 3 comments
Closed

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

timbru opened this issue Jan 27, 2022 · 3 comments

Comments

@timbru
Copy link

timbru commented Jan 27, 2022

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`
@timbru
Copy link
Author

timbru commented Jan 27, 2022

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
Copy link
Contributor

Thanks for the report!

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

@deepu105
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants