Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 6f3c6fd

Browse files
committed
Add oom lang-item implementation for example
1 parent f0a48f6 commit 6f3c6fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

example/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ extern "C" fn panic_fmt(_args: ::core::fmt::Arguments, _file: &'static str, _lin
2525
}
2626
}
2727

28+
// Need to provide a tiny `oom` lang-item implementation for
29+
// `#![no_std]`.
30+
#[lang = "oom"]
31+
extern "C" fn oom() -> ! {
32+
unsafe {
33+
::core::intrinsics::abort();
34+
}
35+
}
36+
2837
// Now, use the allocator via `alloc` types! ///////////////////////////////////
2938

3039
use alloc::boxed::Box;

0 commit comments

Comments
 (0)