diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2023-10-02 14:14:15 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2024-06-11 15:46:59 +0200 |
| commit | 0642cb2994c192b9e910855b7c9a258376c8e0ff (patch) | |
| tree | 9b1c68f5288d502bfa2bc0f1a4e2aa599368bfcd /library/std/src/panic.rs | |
| parent | 0266bbf6e4be7b025f4798046121607c587e94cb (diff) | |
| download | rust-0642cb2994c192b9e910855b7c9a258376c8e0ff.tar.gz rust-0642cb2994c192b9e910855b7c9a258376c8e0ff.zip | |
Remove std::panic::PanicInfo::internal_constructor+set_payload.
We can just set the payload immediately in the constructor, and the constructor does not need to be public.
Diffstat (limited to 'library/std/src/panic.rs')
| -rw-r--r-- | library/std/src/panic.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs index e2d182b4ba0..7adbce859f5 100644 --- a/library/std/src/panic.rs +++ b/library/std/src/panic.rs @@ -44,23 +44,14 @@ pub struct PanicInfo<'a> { } impl<'a> PanicInfo<'a> { - #[unstable(feature = "panic_internals", issue = "none")] - #[doc(hidden)] #[inline] - pub fn internal_constructor( + pub(crate) fn new( location: &'a Location<'a>, + payload: &'a (dyn Any + Send), can_unwind: bool, force_no_backtrace: bool, ) -> Self { - struct NoPayload; - PanicInfo { payload: &NoPayload, location, can_unwind, force_no_backtrace } - } - - #[unstable(feature = "panic_internals", issue = "none")] - #[doc(hidden)] - #[inline] - pub fn set_payload(&mut self, info: &'a (dyn Any + Send)) { - self.payload = info; + PanicInfo { payload, location, can_unwind, force_no_backtrace } } /// Returns the payload associated with the panic. |
