rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

ICE: thread 'rustc' panicked at 'normalization works on validated constants...'

Open bradjc opened this issue 3 years ago • 4 comments

I tried updating Tock to today's nightly and got the following clippy internal error:

    Checking nrf52_components v0.1.0 (/home/runner/work/tock/tock/boards/nordic/nrf52_components)
thread 'rustc' panicked at 'normalization works on validated constants: InterpErrorInfo(InterpErrorInfoInner { kind: using uninitialized data, but this operation requires initialized memory, backtrace: None })', compiler/rustc_const_eval/src/const_eval/eval_queries.rs:138:36
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.65 (c2804e6 2022-09-07)

query stack during panic:
#0 [try_destructure_mir_constant] destructuring mir constant
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `litex_sim`
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:347: ci-job-clippy] Error 101
Error: Process completed with exit code 2.

The full CI output is here: https://github.com/tock/tock/runs/8251506744?check_suite_focus=true

The pull request to update the nightly is here: https://github.com/tock/tock/pull/3168

The crate it appears to be failing on is here: https://github.com/tock/tock/tree/master/boards/nordic/nrf52_components. Note, the PR does not change that particular crate.

bradjc avatar Sep 08 '22 17:09 bradjc

Could be an incremental compilation issue. Try running cargo clean first.

Jarcho avatar Sep 08 '22 20:09 Jarcho

The problem occurs even after running cargo clean, and even if clippy is run to build only a single binary (as opposed to this example, where it is being run on the full workspace)

hudson-ayers avatar Sep 08 '22 20:09 hudson-ayers

Hmm, cc https://github.com/rust-lang/rust/issues/101113

matthiaskrgr avatar Sep 08 '22 21:09 matthiaskrgr

I created an MCVE for this bug: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c5643cbd7ce11d350c914088429b6e2e . It builds fine, but running clippy leads to this ICE.

hudson-ayers avatar Sep 12 '22 19:09 hudson-ayers