Skip to content

Commit 733ca7a

Browse files
committed
Update to the latest nightly
1 parent 1f78bb9 commit 733ca7a

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ infrastructure. Nevertheless, `wee_alloc` is also usable with `std`.
5252

5353
// Required to use the `alloc` crate and its types, the `abort` intrinsic, and a
5454
// custom panic handler.
55-
#![feature(alloc, core_intrinsics, panic_implementation, lang_items)]
55+
#![feature(alloc, core_intrinsics, panic_implementation, lang_items, alloc_error_handler)]
5656

5757
extern crate alloc;
5858
extern crate wee_alloc;
@@ -72,11 +72,11 @@ pub fn panic(_info: &::core::panic::PanicInfo) -> ! {
7272
}
7373
}
7474

75-
// Need to provide a tiny `oom` lang-item implementation for
76-
// `#![no_std]`.
77-
#[lang = "oom"]
75+
// Need to provide an allocation error handler which just aborts
76+
// the execution with trap.
77+
#[alloc_error_handler]
7878
#[no_mangle]
79-
pub extern "C" fn oom() -> ! {
79+
pub extern "C" fn oom(_: ::core::alloc::Layout) -> ! {
8080
unsafe {
8181
::core::intrinsics::abort();
8282
}

example/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// We aren't using the standard library.
77
#![no_std]
88
// Replacing the allocator and using the `alloc` crate are still unstable.
9-
#![feature(alloc, core_intrinsics, panic_implementation, lang_items)]
9+
#![feature(alloc, core_intrinsics, panic_implementation, lang_items, alloc_error_handler)]
1010

1111
extern crate alloc;
1212
extern crate wee_alloc;
@@ -26,11 +26,11 @@ pub fn panic(_info: &::core::panic::PanicInfo) -> ! {
2626
}
2727
}
2828

29-
// Need to provide a tiny `oom` lang-item implementation for
30-
// `#![no_std]`.
31-
#[lang = "oom"]
29+
// Need to provide an allocation error handler which just aborts
30+
// the execution with trap.
31+
#[alloc_error_handler]
3232
#[no_mangle]
33-
pub extern "C" fn oom() -> ! {
33+
pub extern "C" fn oom(_: ::core::alloc::Layout) -> ! {
3434
unsafe {
3535
::core::intrinsics::abort();
3636
}

wee_alloc/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ infrastructure. Nevertheless, `wee_alloc` is also usable with `std`.
5252
5353
// Required to use the `alloc` crate and its types, the `abort` intrinsic, and a
5454
// custom panic handler.
55-
#![feature(alloc, core_intrinsics, panic_implementation, lang_items)]
55+
#![feature(alloc, core_intrinsics, panic_implementation, lang_items, alloc_error_handler)]
5656
5757
extern crate alloc;
5858
extern crate wee_alloc;
@@ -72,11 +72,11 @@ pub fn panic(_info: &::core::panic::PanicInfo) -> ! {
7272
}
7373
}
7474
75-
// Need to provide a tiny `oom` lang-item implementation for
76-
// `#![no_std]`.
77-
#[lang = "oom"]
75+
// Need to provide an allocation error handler which just aborts
76+
// the execution with trap.
77+
#[alloc_error_handler]
7878
#[no_mangle]
79-
pub extern "C" fn oom() -> ! {
79+
pub extern "C" fn oom(_: ::core::alloc::Layout) -> ! {
8080
unsafe {
8181
::core::intrinsics::abort();
8282
}

0 commit comments

Comments
 (0)