Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/ui/codegen/no-mangle-on-panic-handler.rs

15 lines
329 B
Rust
Raw Permalink Normal View History

error when using no_mangle on language items add suggestion on how to add a panic breakpoint Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com> delete no_mangle from ui/panic-handler/panic-handler-wrong-location test issue an error for the usage of #[no_mangle] on internal language items delete the comments add newline rephrase note Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> update error not to leak implementation details delete no_mangle_span Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> delete commented code
2025-04-30 14:52:15 +03:00
// 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 {}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 166ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API