Skip to content

Commit 8047fad

Browse files
committed
Add an exception for windows-msvc
1 parent 1567d4d commit 8047fad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/ui/extern-flag/auxiliary/panic_handler.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#![feature(lang_items)]
22
#![no_std]
33

4+
// Since `rustc` generally passes `-nodefaultlibs` to the linker,
5+
// Rust programs link necessary system libraries via `#[link()]`
6+
// attributes in the `libc` crate. `libc` is a dependency of `std`,
7+
// but as we are `#![no_std]`, we need to include it manually.
8+
// Except on windows-msvc.
9+
#![feature(rustc_private)]
10+
#[cfg(not(all(windows, target_env = "msvc")))]
11+
extern crate libc;
12+
413
#[panic_handler]
514
pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
615
loop {}

0 commit comments

Comments
 (0)