Description
I just found this randomly in a GitHub Actions Workflow run, so I have no idea what could've caused it or if there's already an issue for this.
Code
I'm not sure if this is the relevant code but it's the only code that addresses a global allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
My best guess is that the #[cfg]
doesn't apply to the attribute #[global_allocator]
, but just to the static variable it is qualifying. This means my code is not correct (I should have used #[cfg_attr(feature = "wee_alloc")]
as a guard), so I'd expect this to cause a compiler error considering #[global_allocator]
isn't really attached to anything. However, this ICEd the compiler, which was unexpected.
Meta
rustc --version --verbose
:
rustc 1.52.0-beta.3 (215738137 2021-04-06) running on x86_64-unknown-linux-gnu
(I hard-wrapped the following lines for readability)
compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
--crate-type cdylib --crate-type staticlib
Running rustc --crate-name image_go_nord --edition=2018 src/lib.rs
--error-format=json --json=diagnostic-rendered-ansi --crate-type lib
--crate-type cdylib --crate-type staticlib --emit=dep-info,link
-C embed-bitcode=no -C debuginfo=2 --cfg 'feature="wasm-bindgen"'
-C metadata=c4fb212b5fef003f
--out-dir /home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps
--target wasm32-unknown-unknown
-C incremental=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/incremental
-L dependency=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps
-L dependency=/home/runner/work/ImageGoNord/ImageGoNord/target/debug/deps
--extern image=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libimage-ba9f74439a39eca4.rlib
--extern itertools=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libitertools-6d102d89246fb9d6.rlib
--extern num_traits=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libnum_traits-818b35f1d60294e4.rlib
--extern smallvec=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libsmallvec-e05fe29dfd99833d.rlib
--extern wasm_bindgen=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-ff7d9e442d05e58f.rlib`
Error output
Note: image_go_nord
is my crate name.
Error: thread 'rustc' panicked at 'found unstable fingerprints for has_global_allocator(image_go_nord[2695]): false', /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/compiler/rustc_query_system/src/query/plumbing.rs:593:5
Backtrace
I will post the backtrace when I configure it, but here is the "query stack" for now.
query stack during panic:
#0 [has_global_allocator] checking if the crate has_global_allocator
end of query stack
The action run is publicly availble. If not,
I have attached the relevent log file.