-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uefi_std: Remove unstable features except prelude_import
Most of the unstable features are not required for building. For panics, the only remaining detail is having an implementation of the panic handler (`panic_handler`) itself. - `eh_personality`: Not required with `panic=abort` - `_Unwind_Resume`: Symbol not present with `panic=abort` - `alloc_error_handler`: OOM triggers a panic; feature will be removed [1] [1]: rust-lang/rust#112331 Signed-off-by: Tim Crawford <tcrawford@system76.com>
- Loading branch information
Showing
4 changed files
with
9 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#![no_std] | ||
#![allow(dead_code)] | ||
#![allow(non_snake_case)] | ||
#![no_std] | ||
|
||
#[macro_use] | ||
pub mod macros; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,6 @@ | ||
// These functions are used by the compiler, but not | ||
// for a bare-bones hello world. These are normally | ||
// provided by libstd. | ||
|
||
use core::prelude::rust_2024::alloc_error_handler; | ||
|
||
#[lang = "eh_personality"] | ||
#[no_mangle] | ||
pub extern "C" fn rust_eh_personality() {} | ||
|
||
#[panic_handler] | ||
#[no_mangle] | ||
pub fn rust_begin_panic(pi: &::core::panic::PanicInfo) -> ! { | ||
pub fn panic(pi: &core::panic::PanicInfo) -> ! { | ||
print!("SETUP PANIC: {}", pi); | ||
|
||
loop {} | ||
} | ||
|
||
#[alloc_error_handler] | ||
#[no_mangle] | ||
pub fn rust_oom(layout: ::core::alloc::Layout) -> ! { | ||
println!( | ||
"SETUP OOM: {} bytes aligned to {} bytes\n", | ||
layout.size(), | ||
layout.align() | ||
); | ||
|
||
loop {} | ||
} | ||
|
||
#[allow(non_snake_case)] | ||
#[no_mangle] | ||
pub extern "C" fn _Unwind_Resume() { | ||
loop {} | ||
} |