mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Remove core::panic::PanicInfo::internal_constructor.
It no longer needs to be public.
This commit is contained in:
parent
83dd214f06
commit
0266bbf6e4
@ -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,
|
||||
|
@ -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) }
|
||||
|
Loading…
Reference in New Issue
Block a user