about summary refs log tree commit diff
path: root/tests/ui/codegen/no-mangle-on-panic-handler.rs
blob: 1dc0cce0a2ecebf27e1dd3c866c082d1519950e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Issue an error when the user uses #[no_mangle] on the panic handler
//@ edition:2024

#![crate_type="lib"]
#![no_std]
#![no_main]

use core::panic::PanicInfo;

#[unsafe(no_mangle)] //~ ERROR `#[no_mangle]` cannot be used on internal language items
#[panic_handler]
pub unsafe fn panic_fmt(pi: &PanicInfo) -> ! {
    loop {}
}