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

ICE: thread 'rustc' panicked at 'cannot use the #[rustc_if_this_changed] or #[rustc_then_this_would_need] annotations without supplying -Z query-dep-graph', compiler/rustc_incremental/src/assert_dep_graph.rs:77:13 #77323

Closed
chengniansun opened this issue Sep 29, 2020 · 5 comments
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

#![feature(rustc_attrs)]
#![rustc_if_this_changed]

Meta

rustc --version --verbose:

rustc 1.48.0-nightly (7f7a1cbfd 2020-09-27)
binary: rustc
commit-hash: 7f7a1cbfd3b55daee191247770627afab09eece2
commit-date: 2020-09-27
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0

Error output

thread 'rustc' panicked at 'cannot use the `#[rustc_if_this_changed]` or `#[rustc_then_this_would_need]` annotations without supplying `-Z query-dep-graph`', compiler/rustc_incremental/src/assert_dep_graph.rs:77:13
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-nightly (7f7a1cbfd 2020-09-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `LLVMing`,
 right: `Codegenning`', /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/compiler/rustc_codegen_ssa/src/back/write.rs:1435:21

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-nightly (7f7a1cbfd 2020-09-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib
Backtrace

thread 'rustc' panicked at 'cannot use the `#[rustc_if_this_changed]` or `#[rustc_then_this_would_need]` annotations without supplying `-Z query-dep-graph`', compiler/rustc_incremental/src/assert_dep_graph.rs:77:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panicking.rs:483
   1: std::panicking::begin_panic_fmt
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panicking.rs:437
   2: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   3: rustc_incremental::assert_dep_graph::assert_dep_graph
   4: rustc_session::utils::<impl rustc_session::session::Session>::time
   5: rustc_codegen_ssa::base::finalize_tcx
   6: rustc_codegen_ssa::base::codegen_crate
   7: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   8: rustc_interface::passes::QueryContext::enter
   9: rustc_interface::queries::Queries::ongoing_codegen
  10: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  11: rustc_span::with_source_map
  12: rustc_interface::interface::create_compiler_and_run
  13: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-nightly (7f7a1cbfd 2020-09-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

query stack during panic:
end of query stack

NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses

@chengniansun chengniansun added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2020
@jonas-schievink
Copy link
Contributor

This seems like intended behavior, no?

@chengniansun
Copy link
Author

An error might be better here than a crash. If I remove --crate-type staticlib, the crash goes away but an error is still emitted.

@jonas-schievink
Copy link
Contributor

Ah yeah the second assertion failure looks odd

@camelid camelid added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Sep 30, 2020
@camelid camelid added the P-low Low priority label Dec 8, 2020
@camelid
Copy link
Member

camelid commented Dec 8, 2020

Labeling as P-low because it's incorrect code anyway.

@JohnTitor
Copy link
Member

Triage: Fixed by #83313 and that PR includes the regression test, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants