Rollup merge of #127115 - RalfJung:unreferenced-used-static, r=lqd,ChrisDenton

unreferenced-used-static: run test everywhere

Follow-up to https://github.com/rust-lang/rust/pull/127099.
This commit is contained in:
Jacob Pratt 2024-07-03 03:03:15 -04:00 committed by GitHub
commit 18ec452b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,9 +1,10 @@
// This is a non-regression test for issue #127052 where unreferenced `#[used]` statics couldn't be
// removed by the MSVC linker, causing linking errors.
// This is a non-regression test for issue #127052 where unreferenced `#[used]` statics in the
// binary crate would be marked as "exported", but not be present in the binary, causing linking
// errors with the MSVC linker.
//@ build-pass: needs linking
//@ only-msvc
#[used]
static FOO: u32 = 0;
fn main() {}