2121
2222#![ allow( dead_code, missing_docs) ]
2323#![ unstable(
24- feature = "core_panic " ,
24+ feature = "panic_internals " ,
2525 reason = "internal details of the implementation of the `panic!` and related macros" ,
2626 issue = "none"
2727) ]
@@ -48,7 +48,7 @@ const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C
4848#[ track_caller]
4949#[ lang = "panic_fmt" ] // needed for const-evaluated panics
5050#[ 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" ) ]
5252pub const fn panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
5353 if cfg ! ( feature = "panic_immediate_abort" ) {
5454 super :: intrinsics:: abort ( )
@@ -82,7 +82,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
8282// and unwinds anyway, we will hit the "unwinding out of nounwind function" guard,
8383// which causes a "panic in a function that cannot unwind".
8484#[ rustc_nounwind]
85- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
85+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
8686pub const fn panic_nounwind_fmt ( fmt : fmt:: Arguments < ' _ > , force_no_backtrace : bool ) -> ! {
8787 #[ inline] // this should always be inlined into `panic_nounwind_fmt`
8888 #[ track_caller]
@@ -132,7 +132,7 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
132132#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
133133#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
134134#[ track_caller]
135- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
135+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
136136#[ lang = "panic" ] // needed by codegen for panic on overflow and other `Assert` MIR terminators
137137pub const fn panic ( expr : & ' static str ) -> ! {
138138 // Use Arguments::new_v1 instead of format_args!("{expr}") to potentially
@@ -150,7 +150,7 @@ pub const fn panic(expr: &'static str) -> ! {
150150#[ cfg_attr( feature = "panic_immediate_abort" , inline) ]
151151#[ lang = "panic_nounwind" ] // needed by codegen for non-unwinding panics
152152#[ rustc_nounwind]
153- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
153+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
154154pub const fn panic_nounwind ( expr : & ' static str ) -> ! {
155155 panic_nounwind_fmt ( fmt:: Arguments :: new_const ( & [ expr] ) , /* force_no_backtrace */ false ) ;
156156}
@@ -166,15 +166,15 @@ pub fn panic_nounwind_nobacktrace(expr: &'static str) -> ! {
166166#[ inline]
167167#[ track_caller]
168168#[ rustc_diagnostic_item = "panic_str" ]
169- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
169+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
170170pub const fn panic_str ( expr : & str ) -> ! {
171171 panic_display ( & expr) ;
172172}
173173
174174#[ track_caller]
175175#[ cfg_attr( not( feature = "panic_immediate_abort" ) , inline( never) , cold) ]
176176#[ 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" ) ]
178178pub const fn panic_explicit ( ) -> ! {
179179 panic_display ( & "explicit panic" ) ;
180180}
@@ -191,7 +191,7 @@ pub fn unreachable_display<T: fmt::Display>(x: &T) -> ! {
191191#[ rustc_do_not_const_check] // hooked by const-eval
192192// enforce a &&str argument in const-check and hook this by const-eval
193193#[ rustc_const_panic_str]
194- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
194+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
195195pub const fn panic_display < T : fmt:: Display > ( x : & T ) -> ! {
196196 panic_fmt ( format_args ! ( "{}" , * x) ) ;
197197}
@@ -258,7 +258,7 @@ fn panic_in_cleanup() -> ! {
258258
259259/// This function is used instead of panic_fmt in const eval.
260260#[ lang = "const_panic_fmt" ]
261- #[ rustc_const_unstable( feature = "core_panic " , issue = "none" ) ]
261+ #[ rustc_const_unstable( feature = "panic_internals " , issue = "none" ) ]
262262pub const fn const_panic_fmt ( fmt : fmt:: Arguments < ' _ > ) -> ! {
263263 if let Some ( msg) = fmt. as_str ( ) {
264264 // The panic_display function is hooked by const eval.
0 commit comments