21
21
22
22
#![ allow( dead_code, missing_docs) ]
23
23
#![ unstable(
24
- feature = "core_panic " ,
24
+ feature = "panic_internals " ,
25
25
reason = "internal details of the implementation of the `panic!` and related macros" ,
26
26
issue = "none"
27
27
) ]
@@ -48,7 +48,7 @@ const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C
48
48
#[ track_caller]
49
49
#[ lang = "panic_fmt" ] // needed for const-evaluated panics
50
50
#[ rustc_do_not_const_check] // hooked by const-eval
51
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
51
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
52
52
pub const fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
53
53
if cfg ! ( feature = "panic_immediate_abort" ) {
54
54
super :: intrinsics:: abort ( )
@@ -82,7 +82,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
82
82
// and unwinds anyway, we will hit the "unwinding out of nounwind function" guard,
83
83
// which causes a "panic in a function that cannot unwind".
84
84
#[ rustc_nounwind]
85
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
85
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
86
86
pub const fn panic_nounwind_fmt ( fmt : fmt:: Arguments < ' _ > , force_no_backtrace : bool ) -> ! {
87
87
#[ inline] // this should always be inlined into `panic_nounwind_fmt`
88
88
#[ track_caller]
@@ -132,7 +132,7 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
132
132
#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
133
133
#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
134
134
#[ track_caller]
135
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
135
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
136
136
#[ lang = "panic" ] // needed by codegen for panic on overflow and other `Assert` MIR terminators
137
137
pub const fn panic ( expr : & ' static str ) -> ! {
138
138
// Use Arguments::new_v1 instead of format_args!("{expr}") to potentially
@@ -150,7 +150,7 @@ pub const fn panic(expr: &'static str) -> ! {
150
150
#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
151
151
#[ lang = "panic_nounwind" ] // needed by codegen for non-unwinding panics
152
152
#[ rustc_nounwind]
153
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
153
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
154
154
pub const fn panic_nounwind ( expr : & ' static str ) -> ! {
155
155
panic_nounwind_fmt ( fmt:: Arguments :: new_const ( & [ expr] ) , /* force_no_backtrace */ false ) ;
156
156
}
@@ -166,15 +166,15 @@ pub fn panic_nounwind_nobacktrace(expr: &'static str) -> ! {
166
166
#[ inline]
167
167
#[ track_caller]
168
168
#[ rustc_diagnostic_item = "panic_str" ]
169
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
169
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
170
170
pub const fn panic_str ( expr : & str ) -> ! {
171
171
panic_display ( & expr) ;
172
172
}
173
173
174
174
#[ track_caller]
175
175
#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
176
176
#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
177
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
177
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
178
178
pub const fn panic_explicit ( ) -> ! {
179
179
panic_display ( & "explicit panic" ) ;
180
180
}
@@ -191,7 +191,7 @@ pub fn unreachable_display<T: fmt::Display>(x: &T) -> ! {
191
191
#[ rustc_do_not_const_check] // hooked by const-eval
192
192
// enforce a &&str argument in const-check and hook this by const-eval
193
193
#[ rustc_const_panic_str]
194
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
194
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
195
195
pub const fn panic_display < T : fmt:: Display > ( x : & T ) -> ! {
196
196
panic_fmt ( format_args ! ( "{}" , * x) ) ;
197
197
}
@@ -258,7 +258,7 @@ fn panic_in_cleanup() -> ! {
258
258
259
259
/// This function is used instead of panic_fmt in const eval.
260
260
#[ lang = "const_panic_fmt" ]
261
- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
261
+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
262
262
pub const fn const_panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
263
263
if let Some ( msg) = fmt. as_str ( ) {
264
264
// The panic_display function is hooked by const eval.
0 commit comments