@@ -51,18 +51,10 @@ const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C
5151#[ rustc_do_not_const_check] // hooked by const-eval
5252#[ rustc_const_unstable( feature = "core_panic" , issue = "none" ) ]
5353pub const fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
54- //panic_source(fmt, None)
5554 if cfg ! ( feature = "panic_immediate_abort" ) {
5655 super :: intrinsics:: abort ( )
5756 }
5857
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-
6658 let pi = PanicInfo :: internal_constructor ( Some ( & fmt) , Location :: caller ( ) , None , true ) ;
6759
6860 // 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
8274 super :: intrinsics:: abort ( )
8375 }
8476
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-
9277 let pi = PanicInfo :: internal_constructor ( Some ( & fmt) , Location :: caller ( ) , Some ( source) , true ) ;
9378
9479 // SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call.
9580 unsafe { panic_impl ( & pi) }
9681}
9782
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+
9890/// Like `panic_fmt`, but for non-unwinding panics.
9991///
10092/// Has to be a separate function so that it can carry the `rustc_nounwind` attribute.
0 commit comments