rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.16k stars 318 forks source link

#[used] statics in the local crate are not found #3722

Closed RalfJung closed 3 days ago

RalfJung commented 4 days ago

See the test that got removed in https://github.com/rust-lang/rust/pull/127099: "used" statics in the local crate of a binary are not considered "reachable" by rustc, and so Miri can't find them. This means we fail to run all the thread callbacks on Windows.

Since apparently rustc relies on these truly being considered unreachable, we need to find a different way -- likely be directly iterating all HIR items ourselves, instead of relying on the reachable query.