forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#127099 - lqd:revert-126938, r=<try>
Revert "miri: make sure we can find link_section statics even for the local crate" This PR reverts rust-lang#126938 as [requested by its author](rust-lang#127052 (comment)), to fix the rust-lang#127052 regression. r? ghost fixes rust-lang#127052 We should probably improve the [`used` rmake test(s)](https://github.com/rust-lang/rust/blob/57931e50409f9365791f7923a68f9ae1ec301c4c/tests/run-make/used/rmake.rs#L7) in the future, though this should do for now. (Opening as draft to run tests on a windows env) try-job: x86_64-msvc
- Loading branch information
Showing
4 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
tests/ui/linkage-attr/unreferenced-used-static-issue-127052.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This is a non-regression test for issue #127052 where unreferenced `#[used]` statics couldn't be | ||
// removed by the MSVC linker, causing linking errors. | ||
|
||
//@ build-pass: needs linking | ||
//@ only-msvc | ||
|
||
#[used] | ||
static FOO: u32 = 0; | ||
fn main() {} |