Skip to content

Commit

Permalink
Rollup merge of rust-lang#128603 - ChrisDenton:used, r=jieyouxu
Browse files Browse the repository at this point in the history
Update run-make/used to use `any_symbol_contains`

This makes it so we don't need `nm` or `llvm-nm`.

I also tested that `BAR` is removed. I'm not sure if this is wanted though.
  • Loading branch information
matthiaskrgr committed Aug 3, 2024
2 parents 3a9d432 + eb45146 commit 0655ed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 3 additions & 5 deletions tests/run-make/used/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
// It comes from #39987 which implements this RFC for the #[used] attribute:
// https://rust-lang.github.io/rfcs/2386-used.html

//@ ignore-msvc

use run_make_support::{cmd, rustc};
use run_make_support::rustc;
use run_make_support::symbols::any_symbol_contains;

fn main() {
rustc().opt_level("3").emit("obj").input("used.rs").run();

cmd("nm").arg("used.o").run().assert_stdout_contains("FOO");
assert!(any_symbol_contains("used.o", &["FOO"]));
}
2 changes: 0 additions & 2 deletions tests/run-make/used/used.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@

#[used]
static FOO: u32 = 0;

static BAR: u32 = 0;

0 comments on commit 0655ed2

Please sign in to comment.