about summary refs log tree commit diff
path: root/library/std/src/panicking.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2023-10-02 14:16:10 +0200
committerMara Bos <m-ou.se@m-ou.se>2024-06-11 15:46:59 +0200
commit22f7399b32dcf1bd4d38b7e88a9b482fba889a8f (patch)
tree8ddfe2706f27b31ff7e578eea082e63b5cf21821 /library/std/src/panicking.rs
parent4e356f3184ff43aeb68968a8ab96a0faacf6281b (diff)
downloadrust-22f7399b32dcf1bd4d38b7e88a9b482fba889a8f.tar.gz
rust-22f7399b32dcf1bd4d38b7e88a9b482fba889a8f.zip
Use unnamed lifetimes for [..]Payload impl blocks.
Diffstat (limited to 'library/std/src/panicking.rs')
-rw-r--r--library/std/src/panicking.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 53df0bb40b5..a460f41b93d 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -597,11 +597,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
         string: Option<String>,
     }
 
-    impl<'a> FormatStringPayload<'a> {
-        fn new(inner: &'a fmt::Arguments<'a>) -> Self {
-            Self { inner, string: None }
-        }
-
+    impl FormatStringPayload<'_> {
         fn fill(&mut self) -> &mut String {
             use crate::fmt::Write;
 
@@ -615,7 +611,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
         }
     }
 
-    unsafe impl<'a> PanicPayload for FormatStringPayload<'a> {
+    unsafe impl PanicPayload for FormatStringPayload<'_> {
         fn take_box(&mut self) -> *mut (dyn Any + Send) {
             // We do two allocations here, unfortunately. But (a) they're required with the current
             // scheme, and (b) we don't handle panic + OOM properly anyway (see comment in
@@ -654,7 +650,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
             );
         } else {
             rust_panic_with_hook(
-                &mut FormatStringPayload::new(&msg),
+                &mut FormatStringPayload { inner: &msg, string: None },
                 Some(msg),
                 loc,
                 info.can_unwind(),