@@ -49,14 +49,14 @@ compile_error!(
4949/// the actual formatting into this shared place.
5050// If panic=immediate-abort, inline the abort call,
5151// otherwise avoid inlining because of it is cold path.
52- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
53- #[ cfg_attr( panic = "immediate_abort " , inline) ]
52+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
53+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
5454#[ track_caller]
5555#[ lang = "panic_fmt" ] // needed for const-evaluated panics
5656#[ rustc_do_not_const_check] // hooked by const-eval
5757#[ rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
5858pub const fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
59- if cfg ! ( panic = "immediate_abort " ) {
59+ if cfg ! ( panic = "immediate-abort " ) {
6060 super :: intrinsics:: abort ( )
6161 }
6262
@@ -81,8 +81,8 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
8181/// Like `panic_fmt`, but for non-unwinding panics.
8282///
8383/// Has to be a separate function so that it can carry the `rustc_nounwind` attribute.
84- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
85- #[ cfg_attr( panic = "immediate_abort " , inline) ]
84+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
85+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
8686#[ track_caller]
8787// This attribute has the key side-effect that if the panic handler ignores `can_unwind`
8888// and unwinds anyway, we will hit the "unwinding out of nounwind function" guard,
@@ -97,7 +97,7 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
9797 // We don't unwind anyway at compile-time so we can call the regular `panic_fmt`.
9898 panic_fmt( fmt)
9999 } else #[ track_caller] {
100- if cfg!( panic = "immediate_abort " ) {
100+ if cfg!( panic = "immediate-abort " ) {
101101 super :: intrinsics:: abort( )
102102 }
103103
@@ -128,8 +128,8 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
128128/// The underlying implementation of core's `panic!` macro when no formatting is used.
129129// Never inline unless panic=immediate-abort to avoid code
130130// bloat at the call sites as much as possible.
131- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
132- #[ cfg_attr( panic = "immediate_abort " , inline) ]
131+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
132+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
133133#[ track_caller]
134134#[ rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
135135#[ lang = "panic" ] // used by lints and miri for panics
@@ -163,8 +163,8 @@ macro_rules! panic_const {
163163 //
164164 // never inline unless panic=immediate-abort to avoid code
165165 // bloat at the call sites as much as possible
166- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
167- #[ cfg_attr( panic = "immediate_abort " , inline) ]
166+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
167+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
168168 #[ track_caller]
169169 #[ rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
170170 #[ lang = stringify!( $lang) ]
@@ -219,8 +219,8 @@ pub mod panic_const {
219219
220220/// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize on the caller.
221221/// If you want `#[track_caller]` for nicer errors, call `panic_nounwind_fmt` directly.
222- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
223- #[ cfg_attr( panic = "immediate_abort " , inline) ]
222+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
223+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
224224#[ lang = "panic_nounwind" ] // needed by codegen for non-unwinding panics
225225#[ rustc_nounwind]
226226#[ rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
@@ -229,8 +229,8 @@ pub const fn panic_nounwind(expr: &'static str) -> ! {
229229}
230230
231231/// Like `panic_nounwind`, but also inhibits showing a backtrace.
232- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold) ]
233- #[ cfg_attr( panic = "immediate_abort " , inline) ]
232+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold) ]
233+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
234234#[ rustc_nounwind]
235235pub fn panic_nounwind_nobacktrace ( expr : & ' static str ) -> ! {
236236 panic_nounwind_fmt ( fmt:: Arguments :: new_const ( & [ expr] ) , /* force_no_backtrace */ true ) ;
@@ -262,25 +262,25 @@ pub const fn panic_display<T: fmt::Display>(x: &T) -> ! {
262262 panic_fmt ( format_args ! ( "{}" , * x) ) ;
263263}
264264
265- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
266- #[ cfg_attr( panic = "immediate_abort " , inline) ]
265+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
266+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
267267#[ track_caller]
268268#[ lang = "panic_bounds_check" ] // needed by codegen for panic on OOB array/slice access
269269fn panic_bounds_check ( index : usize , len : usize ) -> ! {
270- if cfg ! ( panic = "immediate_abort " ) {
270+ if cfg ! ( panic = "immediate-abort " ) {
271271 super :: intrinsics:: abort ( )
272272 }
273273
274274 panic ! ( "index out of bounds: the len is {len} but the index is {index}" )
275275}
276276
277- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
278- #[ cfg_attr( panic = "immediate_abort " , inline) ]
277+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
278+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
279279#[ track_caller]
280280#[ lang = "panic_misaligned_pointer_dereference" ] // needed by codegen for panic on misaligned pointer deref
281281#[ rustc_nounwind] // `CheckAlignment` MIR pass requires this function to never unwind
282282fn panic_misaligned_pointer_dereference ( required : usize , found : usize ) -> ! {
283- if cfg ! ( panic = "immediate_abort " ) {
283+ if cfg ! ( panic = "immediate-abort " ) {
284284 super :: intrinsics:: abort ( )
285285 }
286286
@@ -292,13 +292,13 @@ fn panic_misaligned_pointer_dereference(required: usize, found: usize) -> ! {
292292 )
293293}
294294
295- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
296- #[ cfg_attr( panic = "immediate_abort " , inline) ]
295+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
296+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
297297#[ track_caller]
298298#[ lang = "panic_null_pointer_dereference" ] // needed by codegen for panic on null pointer deref
299299#[ rustc_nounwind] // `CheckNull` MIR pass requires this function to never unwind
300300fn panic_null_pointer_dereference ( ) -> ! {
301- if cfg ! ( panic = "immediate_abort " ) {
301+ if cfg ! ( panic = "immediate-abort " ) {
302302 super :: intrinsics:: abort ( )
303303 }
304304
@@ -308,13 +308,13 @@ fn panic_null_pointer_dereference() -> ! {
308308 )
309309}
310310
311- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
312- #[ cfg_attr( panic = "immediate_abort " , inline) ]
311+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
312+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
313313#[ track_caller]
314314#[ lang = "panic_invalid_enum_construction" ] // needed by codegen for panic on invalid enum construction.
315315#[ rustc_nounwind] // `CheckEnums` MIR pass requires this function to never unwind
316316fn panic_invalid_enum_construction ( source : u128 ) -> ! {
317- if cfg ! ( panic = "immediate_abort " ) {
317+ if cfg ! ( panic = "immediate-abort " ) {
318318 super :: intrinsics:: abort ( )
319319 }
320320
@@ -331,8 +331,8 @@ fn panic_invalid_enum_construction(source: u128) -> ! {
331331///
332332/// This function is called directly by the codegen backend, and must not have
333333/// any extra arguments (including those synthesized by track_caller).
334- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
335- #[ cfg_attr( panic = "immediate_abort " , inline) ]
334+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
335+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
336336#[ lang = "panic_cannot_unwind" ] // needed by codegen for panic in nounwind function
337337#[ rustc_nounwind]
338338fn panic_cannot_unwind ( ) -> ! {
@@ -347,8 +347,8 @@ fn panic_cannot_unwind() -> ! {
347347///
348348/// This function is called directly by the codegen backend, and must not have
349349/// any extra arguments (including those synthesized by track_caller).
350- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
351- #[ cfg_attr( panic = "immediate_abort " , inline) ]
350+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
351+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
352352#[ lang = "panic_in_cleanup" ] // needed by codegen for panic in nounwind function
353353#[ rustc_nounwind]
354354fn panic_in_cleanup ( ) -> ! {
@@ -380,8 +380,8 @@ pub enum AssertKind {
380380}
381381
382382/// Internal function for `assert_eq!` and `assert_ne!` macros
383- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
384- #[ cfg_attr( panic = "immediate_abort " , inline) ]
383+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
384+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
385385#[ track_caller]
386386#[ doc( hidden) ]
387387pub fn assert_failed < T , U > (
@@ -398,8 +398,8 @@ where
398398}
399399
400400/// Internal function for `assert_match!`
401- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
402- #[ cfg_attr( panic = "immediate_abort " , inline) ]
401+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
402+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
403403#[ track_caller]
404404#[ doc( hidden) ]
405405pub fn assert_matches_failed < T : fmt:: Debug + ?Sized > (
@@ -418,8 +418,8 @@ pub fn assert_matches_failed<T: fmt::Debug + ?Sized>(
418418}
419419
420420/// Non-generic version of the above functions, to avoid code bloat.
421- #[ cfg_attr( not( panic = "immediate_abort " ) , inline( never) , cold, optimize( size) ) ]
422- #[ cfg_attr( panic = "immediate_abort " , inline) ]
421+ #[ cfg_attr( not( panic = "immediate-abort " ) , inline( never) , cold, optimize( size) ) ]
422+ #[ cfg_attr( panic = "immediate-abort " , inline) ]
423423#[ track_caller]
424424fn assert_failed_inner (
425425 kind : AssertKind ,
0 commit comments