We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1567d4d commit 8047fadCopy full SHA for 8047fad
tests/ui/extern-flag/auxiliary/panic_handler.rs
@@ -1,6 +1,15 @@
1
#![feature(lang_items)]
2
#![no_std]
3
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
+
13
#[panic_handler]
14
pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
15
loop {}
0 commit comments