diff --git a/core/src/panic/panic_info.rs b/core/src/panic/panic_info.rs index 5b784ff4f80a3..2a0cd8fda61ba 100644 --- a/core/src/panic/panic_info.rs +++ b/core/src/panic/panic_info.rs @@ -24,14 +24,8 @@ pub struct PanicInfo<'a> { } impl<'a> PanicInfo<'a> { - #[unstable( - feature = "panic_internals", - reason = "internal details of the implementation of the `panic!` and related macros", - issue = "none" - )] - #[doc(hidden)] #[inline] - pub fn internal_constructor( + pub(crate) fn new( message: fmt::Arguments<'a>, location: &'a Location<'a>, can_unwind: bool, diff --git a/core/src/panicking.rs b/core/src/panicking.rs index aa11ae28dcb15..a6e5528094605 100644 --- a/core/src/panicking.rs +++ b/core/src/panicking.rs @@ -63,7 +63,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! { fn panic_impl(pi: &PanicInfo<'_>) -> !; } - let pi = PanicInfo::internal_constructor( + let pi = PanicInfo::new( fmt, Location::caller(), /* can_unwind */ true, @@ -101,12 +101,8 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo } // PanicInfo with the `can_unwind` flag set to false forces an abort. - let pi = PanicInfo::internal_constructor( - &fmt, - Location::caller(), - /* can_unwind */ false, - force_no_backtrace, - ); + let pi = + PanicInfo::new(fmt, Location::caller(), /* can_unwind */ false, force_no_backtrace); // SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call. unsafe { panic_impl(&pi) }