@@ -518,7 +518,7 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments,
518518
519519 let mut s = String :: new ( ) ;
520520 let _ = s. write_fmt ( * msg) ;
521- begin_panic_new ( s, file_line_col)
521+ begin_panic ( s, file_line_col)
522522}
523523
524524// FIXME: In PR #42938, we have added the column as info passed to the panic
@@ -529,15 +529,17 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments,
529529// By changing the compiler source, we can only affect behaviour of higher
530530// stages. We need to perform the switch over two stage0 replacements, using
531531// a temporary function begin_panic_new while performing the switch:
532- // 0. Right now, we tell stage1 onward to emit a call to begin_panic_new.
533- // 1. In the first SNAP, stage0 calls begin_panic_new with the new ABI,
534- // begin_panic stops being used. Now we can change begin_panic to
535- // the new ABI, and start emitting calls to begin_panic in higher
532+ // 0. Before the current switch, we told stage1 onward to emit a call
533+ // to begin_panic_new.
534+ // 1. Right now, stage0 calls begin_panic_new with the new ABI,
535+ // begin_panic stops being used. We have changed begin_panic to
536+ // the new ABI, and started to emit calls to begin_panic in higher
536537// stages again, this time with the new ABI.
537538// 2. After the second SNAP, stage0 calls begin_panic with the new ABI,
538539// and we can remove the temporary begin_panic_new function.
539540
540541/// This is the entry point of panicking for panic!() and assert!().
542+ #[ cfg( stage0) ]
541543#[ unstable( feature = "libstd_sys_internals" ,
542544 reason = "used by the panic! macro" ,
543545 issue = "0" ) ]
@@ -558,18 +560,15 @@ pub fn begin_panic_new<M: Any + Send>(msg: M, file_line_col: &(&'static str, u32
558560 reason = "used by the panic! macro" ,
559561 issue = "0" ) ]
560562#[ inline( never) ] #[ cold] // avoid code bloat at the call sites as much as possible
561- pub fn begin_panic < M : Any + Send > ( msg : M , file_line : & ( & ' static str , u32 ) ) -> ! {
563+ pub fn begin_panic < M : Any + Send > ( msg : M , file_line_col : & ( & ' static str , u32 , u32 ) ) -> ! {
562564 // Note that this should be the only allocation performed in this code path.
563565 // Currently this means that panic!() on OOM will invoke this code path,
564566 // but then again we're not really ready for panic on OOM anyway. If
565567 // we do start doing this, then we should propagate this allocation to
566568 // be performed in the parent of this thread instead of the thread that's
567569 // panicking.
568570
569- let ( file, line) = * file_line;
570- let file_line_col = ( file, line, 0 ) ;
571-
572- rust_panic_with_hook ( Box :: new ( msg) , & file_line_col)
571+ rust_panic_with_hook ( Box :: new ( msg) , file_line_col)
573572}
574573
575574/// Executes the primary logic for a panic, including checking for recursive
0 commit comments