@@ -48,7 +48,6 @@ pub macro panic_2015 {
48
48
#[ allow_internal_unstable( panic_internals, const_format_args) ]
49
49
#[ rustc_diagnostic_item = "core_panic_2021_macro" ]
50
50
#[ rustc_macro_transparency = "semitransparent" ]
51
- #[ cfg( feature = "panic_immediate_abort" ) ]
52
51
pub macro panic_2021 {
53
52
( ) => (
54
53
$crate:: panicking:: panic ( "explicit panic" )
@@ -64,50 +63,6 @@ pub macro panic_2021 {
64
63
} ) ,
65
64
}
66
65
67
- #[ doc ( hidden) ]
68
- #[ unstable( feature = "edition_panic" , issue = "none" , reason = "use panic!() instead" ) ]
69
- #[ allow_internal_unstable(
70
- panic_internals,
71
- core_intrinsics,
72
- const_dispatch,
73
- const_eval_select,
74
- const_format_args,
75
- rustc_attrs
76
- ) ]
77
- #[ rustc_diagnostic_item = "core_panic_2021_macro" ]
78
- #[ rustc_macro_transparency = "semitransparent" ]
79
- #[ cfg( not( feature = "panic_immediate_abort" ) ) ]
80
- pub macro panic_2021 {
81
- ( ) => ( {
82
- // Create a function so that the argument for `track_caller`
83
- // can be moved inside if possible.
84
- #[ cold]
85
- #[ track_caller]
86
- #[ inline( never) ]
87
- const fn panic_cold_explicit ( ) -> ! {
88
- $crate:: panicking:: panic_explicit ( )
89
- }
90
- panic_cold_explicit ( ) ;
91
- } ) ,
92
- // Special-case the single-argument case for const_panic.
93
- ( "{}" , $arg: expr $( , ) ?) => ( {
94
- #[ cold]
95
- #[ track_caller]
96
- #[ inline( never) ]
97
- #[ rustc_const_panic_str] // enforce a &&str argument in const-check and hook this by const-eval
98
- #[ rustc_do_not_const_check] // hooked by const-eval
99
- const fn panic_cold_display < T : $crate:: fmt:: Display > ( arg : & T ) -> ! {
100
- $crate:: panicking:: panic_display ( arg)
101
- }
102
- panic_cold_display ( & $arg) ;
103
- } ) ,
104
- ( $( $t: tt) +) => ( {
105
- // Semicolon to prevent temporaries inside the formatting machinery from
106
- // being considered alive in the caller after the panic_fmt call.
107
- $crate:: panicking:: panic_fmt ( $crate:: const_format_args!( $( $t) +) ) ;
108
- } ) ,
109
- }
110
-
111
66
#[ doc ( hidden) ]
112
67
#[ unstable( feature = "edition_panic" , issue = "none" , reason = "use unreachable!() instead" ) ]
113
68
#[ allow_internal_unstable( panic_internals) ]
0 commit comments