Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 701d6a2

Browse files
committedJun 11, 2024
Remove core::panic::PanicInfo::internal_constructor.
It no longer needs to be public.
1 parent cca865d commit 701d6a2

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed
 

‎core/src/panic/panic_info.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,8 @@ pub struct PanicInfo<'a> {
2424
}
2525

2626
impl<'a> PanicInfo<'a> {
27-
#[unstable(
28-
feature = "panic_internals",
29-
reason = "internal details of the implementation of the `panic!` and related macros",
30-
issue = "none"
31-
)]
32-
#[doc(hidden)]
3327
#[inline]
34-
pub fn internal_constructor(
28+
pub(crate) fn new(
3529
message: fmt::Arguments<'a>,
3630
location: &'a Location<'a>,
3731
can_unwind: bool,

‎core/src/panicking.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
6363
fn panic_impl(pi: &PanicInfo<'_>) -> !;
6464
}
6565

66-
let pi = PanicInfo::internal_constructor(
66+
let pi = PanicInfo::new(
6767
fmt,
6868
Location::caller(),
6969
/* can_unwind */ true,
@@ -101,12 +101,8 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
101101
}
102102

103103
// PanicInfo with the `can_unwind` flag set to false forces an abort.
104-
let pi = PanicInfo::internal_constructor(
105-
&fmt,
106-
Location::caller(),
107-
/* can_unwind */ false,
108-
force_no_backtrace,
109-
);
104+
let pi =
105+
PanicInfo::new(fmt, Location::caller(), /* can_unwind */ false, force_no_backtrace);
110106

111107
// SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call.
112108
unsafe { panic_impl(&pi) }

0 commit comments

Comments
 (0)
Failed to load comments.