Skip to content

Commit dc5b289

Browse files
authored
Rollup merge of #128807 - ChrisDenton:bloat, r=jieyouxu
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: i686-msvc
2 parents f536b4e + 67518d0 commit dc5b289

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

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

8-
#[link(name = "c")]
8+
#[cfg_attr(not(target_env = "msvc"), link(name = "c"))]
9+
#[cfg_attr(all(target_env = "msvc", target_feature = "crt-static"), link(name = "libcmt"))]
10+
#[cfg_attr(all(target_env = "msvc", not(target_feature = "crt-static")), link(name = "msvcrt"))]
911
extern "C" {}
1012

1113
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)