Remove core::panic::PanicInfo::internal_constructor.

It no longer needs to be public.
This commit is contained in:
Mara Bos 2023-10-02 14:13:05 +02:00
parent 83dd214f06
commit 0266bbf6e4
2 changed files with 4 additions and 14 deletions

View File

@ -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,

View File

@ -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) }