Skip to content

rust-analyzer compiler error (not issue with code) #129380

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

Closed
MaximusTheGladiator opened this issue Aug 21, 2024 · 2 comments
Closed

rust-analyzer compiler error (not issue with code) #129380

MaximusTheGladiator opened this issue Aug 21, 2024 · 2 comments
Labels
A-incr-comp Area: Incremental compilation 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.

Comments

@MaximusTheGladiator
Copy link

rustc 1.79.0 (129f3b9 2024-06-10)

2024-08-21T22:48:10.870387Z ERROR Flycheck failed to run the following command: CommandHandle { program: "/home/maximus/.cargo/bin/cargo", arguments: ["check", "--workspace", "--message-format=json-diagnostic-rendered-ansi", "--manifest-path", "/home/maximus/gppen-rs/Cargo.toml", "--keep-going", "--all-targets"], current_dir: Some("/home/maximus/gppen-rs") }, error=Cargo watcher failed, the command produced no valid metadata (exit code: ExitStatus(unix_wait_status(25856))):
warning: version requirement 0.37.0+1.3.254 for dependency ash includes semver metadata which will be ignored, removing the metadata is recommended to avoid confusion
Checking gppen-rs v0.1.0 (/home/maximus/gppen-rs)
thread 'rustc' panicked at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/compiler/rustc_query_system/src/dep_graph/serialized.rs:192:9:
assertion left == right failed
left: 4360117
right: 0
stack backtrace:
thread 'rustc' panicked at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/compiler/rustc_query_system/src/dep_graph/serialized.rs:192:9:
assertion left == right failed
left: 4327810
right: 0
stack backtrace:
0: rust_begin_unwind
0: rust_begin_unwind
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
1: core::panicking::panic_fmt
1: core::panicking::panic_fmt
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
2: core::panicking::assert_failed_inner
2: core::panicking::assert_failed_inner
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:409:17
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:409:17
3: core::panicking::assert_failed::<usize, usize>
3: core::panicking::assert_failed::<usize, usize>
4: rustc_incremental::persist::load::setup_dep_graph
4: rustc_incremental::persist::load::setup_dep_graph
5: <rustc_interface::queries::Queries>::global_ctxt
5: <rustc_interface::queries::Queries>::global_ctxt
6: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
6: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

error: 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
error: the compiler unexpectedly panicked. this is a bug.

note: rustc 1.79.0 (129f3b9 2024-06-10) running on x86_64-unknown-linux-gnu

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.79.0 (129f3b9 2024-06-10) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
note: some of the compiler flags provided by cargo are hidden
end of query stack

query stack during panic:
end of query stack
error: could not compile gppen-rs (bin "gppen-rs" test)
warning: build failed, waiting for other jobs to finish...
error: could not compile gppen-rs (bin "gppen-rs")

@MaximusTheGladiator MaximusTheGladiator 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 Aug 21, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 21, 2024
@MaximusTheGladiator
Copy link
Author

Error was resolved when I updated to rustc 1.80.1 (3f5fd8d 2024-08-06)

@saethlin
Copy link
Member

The root cause is either fixed or papered over by #124686 which indeed shipped in 1.80.

But the reason you don't see the ICE anymore in this case is that by updating your compiler version you've caused the incremental compilation cache to be discarded, and the crash here only happens when the cache has been corrupted.

@saethlin saethlin added A-incr-comp Area: Incremental compilation and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation 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.
Projects
None yet
Development

No branches or pull requests

3 participants