Skip to content

Commit 1797ae5

Browse files
committed
Define rust_eh_personality for alloc_example
x86_64-pc-windows-gnu requires it to be defined.
1 parent aeac484 commit 1797ae5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

example/alloc_example.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(start, core_intrinsics, alloc_error_handler)]
1+
#![feature(start, core_intrinsics, alloc_error_handler, lang_items)]
22
#![no_std]
33

44
extern crate alloc;
@@ -27,6 +27,11 @@ fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
2727
core::intrinsics::abort();
2828
}
2929

30+
#[lang = "eh_personality"]
31+
fn eh_personality() -> ! {
32+
loop {}
33+
}
34+
3035
#[start]
3136
fn main(_argc: isize, _argv: *const *const u8) -> isize {
3237
let world: Box<&str> = Box::new("Hello World!\0");

0 commit comments

Comments
 (0)