@@ -64,12 +64,13 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
64
64
unsafe { panic_impl ( & pi) }
65
65
}
66
66
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.)
69
69
#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
70
70
#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
71
+ #[ cfg_attr( not( bootstrap) , lang = "panic_nounwind" ) ] // needed by codegen for non-unwinding panics
71
72
#[ rustc_nounwind]
72
- pub fn panic_str_nounwind ( msg : & ' static str ) -> ! {
73
+ pub fn panic_nounwind ( msg : & ' static str ) -> ! {
73
74
if cfg ! ( feature = "panic_immediate_abort" ) {
74
75
super :: intrinsics:: abort ( )
75
76
}
@@ -153,10 +154,11 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
153
154
/// any extra arguments (including those synthesized by track_caller).
154
155
#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
155
156
#[ 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
157
159
#[ 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" )
160
162
}
161
163
162
164
/// This function is used instead of panic_fmt in const eval.
0 commit comments