Skip to content

Commit 7dd8f8b

Browse files
committed
Auto merge of #128807 - ChrisDenton:bloat, r=<try>
run-make: run fmt-write-bloat on Windows The trouble here is that libc doesn't exist on Windows. Well it kinda does but it isn't called that so we substitute a name that works. Ideally finding necessary libs for the platform would be done at a higher level but until then this should work. try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw
2 parents d3a3939 + a33003b commit 7dd8f8b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/tools/run-make-support/src/symbols.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn any_symbol_contains(path: impl AsRef<Path>, substrings: &[&str]) -> bool
3232
.name_bytes()
3333
.unwrap()
3434
.windows(substring.len())
35-
.any(|x| x == substring.as_bytes())
35+
.any(|x| x == substring.as_bytes() && !x.starts_with(b"__imp_"))
3636
{
3737
eprintln!("{:?} contains {}", sym, substring);
3838
return true;

tests/run-make/fmt-write-bloat/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use core::fmt;
66
use core::fmt::Write;
77

8-
#[link(name = "c")]
8+
#[cfg_attr(not(windows), link(name = "c"))]
99
extern "C" {}
1010

1111
struct Dummy;

tests/run-make/fmt-write-bloat/rmake.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515
//! `NO_DEBUG_ASSERTIONS=1`). If debug assertions are disabled, then we can check for the absence of
1616
//! additional `usize` formatting and padding related symbols.
1717
18-
// Reason: This test is `ignore-windows` because the `no_std` test (using `#[link(name = "c")])`
19-
// doesn't link on windows.
20-
//@ ignore-windows
2118
//@ ignore-cross-compile
2219

2320
use run_make_support::env::no_debug_assertions;
24-
use run_make_support::rustc;
2521
use run_make_support::symbols::any_symbol_contains;
22+
use run_make_support::{bin_name, rustc};
2623

2724
fn main() {
2825
rustc().input("main.rs").opt().run();
@@ -33,5 +30,5 @@ fn main() {
3330
// otherwise, add them to the list of symbols to deny.
3431
panic_syms.extend_from_slice(&["panicking", "panic_fmt", "pad_integral", "Display"]);
3532
}
36-
assert!(!any_symbol_contains("main", &panic_syms));
33+
assert!(!any_symbol_contains(&bin_name("main"), &panic_syms));
3734
}

0 commit comments

Comments
 (0)