Add first user program hello_world.rs
This commit is contained in:
parent
c701cd00ce
commit
db0c174f52
79 changed files with 343 additions and 0 deletions
10
user/src/lang_items.rs
Normal file
10
user/src/lang_items.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
#[panic_handler]
|
||||
fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! {
|
||||
let err = panic_info.message().unwrap();
|
||||
if let Some(location) = panic_info.location() {
|
||||
println!("Panicked at {}:{}, {}", location.file(), location.line(), err);
|
||||
} else {
|
||||
println!("Panicked: {}", err);
|
||||
}
|
||||
loop {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue