@@ -51,18 +51,10 @@ const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C
51
51
#[ rustc_do_not_const_check] // hooked by const-eval
52
52
#[ rustc_const_unstable( feature = "core_panic" , issue = "none" ) ]
53
53
pub const fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
54
- //panic_source(fmt, None)
55
54
if cfg ! ( feature = "panic_immediate_abort" ) {
56
55
super :: intrinsics:: abort ( )
57
56
}
58
57
59
- // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
60
- // that gets resolved to the `#[panic_handler]` function.
61
- extern "Rust" {
62
- #[ lang = "panic_impl" ]
63
- fn panic_impl ( pi : & PanicInfo < ' _ > ) -> !;
64
- }
65
-
66
58
let pi = PanicInfo :: internal_constructor ( Some ( & fmt) , Location :: caller ( ) , None , true ) ;
67
59
68
60
// SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call.
@@ -82,19 +74,19 @@ pub const fn panic_source(fmt: fmt::Arguments<'_>, source: &(dyn Error + 'static
82
74
super :: intrinsics:: abort ( )
83
75
}
84
76
85
- // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
86
- // that gets resolved to the `#[panic_handler]` function.
87
- extern "Rust" {
88
- #[ lang = "panic_impl" ]
89
- fn panic_impl ( pi : & PanicInfo < ' _ > ) -> !;
90
- }
91
-
92
77
let pi = PanicInfo :: internal_constructor ( Some ( & fmt) , Location :: caller ( ) , Some ( source) , true ) ;
93
78
94
79
// SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call.
95
80
unsafe { panic_impl ( & pi) }
96
81
}
97
82
83
+ // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
84
+ // that gets resolved to the `#[panic_handler]` function.
85
+ extern "Rust" {
86
+ #[ lang = "panic_impl" ]
87
+ fn panic_impl ( pi : & PanicInfo < ' _ > ) -> !;
88
+ }
89
+
98
90
/// Like `panic_fmt`, but for non-unwinding panics.
99
91
///
100
92
/// Has to be a separate function so that it can carry the `rustc_nounwind` attribute.
0 commit comments