2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,8 @@ pub struct PanicInfo<'a> {
24
24
}
25
25
26
26
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) ]
33
27
#[ inline]
34
- pub fn internal_constructor (
28
+ pub ( crate ) fn new (
35
29
message : fmt:: Arguments < ' a > ,
36
30
location : & ' a Location < ' a > ,
37
31
can_unwind : bool ,
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
63
63
fn panic_impl ( pi : & PanicInfo < ' _ > ) -> !;
64
64
}
65
65
66
- let pi = PanicInfo :: internal_constructor (
66
+ let pi = PanicInfo :: new (
67
67
fmt,
68
68
Location :: caller ( ) ,
69
69
/* can_unwind */ true ,
@@ -101,12 +101,8 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
101
101
}
102
102
103
103
// 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) ;
110
106
111
107
// SAFETY: `panic_impl` is defined in safe Rust code and thus is safe to call.
112
108
unsafe { panic_impl ( & pi) }
0 commit comments