Given the following code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=eda11ad1f58bb9579e1a515f26b30846
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[panic_handler]
fn panik(_: &PanicInfo) -> ! {
loop {}
}
#[panic_handler]
fn panik2(_: &PanicInfo) -> ! {
loop {}
}
The current output is:
error[E0152]: found duplicate lang item `panic_impl`
--> src/lib.rs:12:1
|
12 | fn panik2(_: &PanicInfo) -> ! {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lang item is first defined here
--> src/lib.rs:7:1
|
7 | fn panik(_: &PanicInfo) -> ! {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0152`.
"lang items" are an internal, perma-unstable implementation detail and should not be mentioned in this error message.
The error should probably also suggest a resolution, namely removing one of the panic handler functions.
This error is hit fairly often by people new to bare-metal Rust.
Given the following code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=eda11ad1f58bb9579e1a515f26b30846
The current output is:
"lang items" are an internal, perma-unstable implementation detail and should not be mentioned in this error message.
The error should probably also suggest a resolution, namely removing one of the panic handler functions.
This error is hit fairly often by people new to bare-metal Rust.