@@ -64,12 +64,13 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
6464 unsafe { panic_impl ( & pi) }
6565}
6666
67- /// Like panic_fmt , but without unwinding and track_caller to reduce the impact on codesize.
68- /// Also just works on `str`, as a `fmt::Arguments` needs more space to be passed.
67+ /// Like `panic` , but without unwinding and track_caller to reduce the impact on codesize.
68+ /// (No `fmt` variant as a `fmt::Arguments` needs more space to be passed.)
6969#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
7070#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
71+ #[ cfg_attr( not( bootstrap) , lang = "panic_nounwind" ) ] // needed by codegen for non-unwinding panics
7172#[ rustc_nounwind]
72- pub fn panic_str_nounwind ( msg : & ' static str ) -> ! {
73+ pub fn panic_nounwind ( msg : & ' static str ) -> ! {
7374 if cfg ! ( feature = "panic_immediate_abort" ) {
7475 super :: intrinsics:: abort ( )
7576 }
@@ -153,10 +154,11 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
153154/// any extra arguments (including those synthesized by track_caller).
154155#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
155156#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
156- #[ lang = "panic_no_unwind" ] // needed by codegen for panic in nounwind function
157+ #[ cfg_attr( bootstrap, lang = "panic_no_unwind" ) ] // needed by codegen for panic in nounwind function
158+ #[ cfg_attr( not( bootstrap) , lang = "panic_cannot_unwind" ) ] // needed by codegen for panic in nounwind function
157159#[ rustc_nounwind]
158- fn panic_no_unwind ( ) -> ! {
159- panic_str_nounwind ( "panic in a function that cannot unwind" )
160+ fn panic_cannot_unwind ( ) -> ! {
161+ panic_nounwind ( "panic in a function that cannot unwind" )
160162}
161163
162164/// This function is used instead of panic_fmt in const eval.
0 commit comments