Use unnamed lifetimes for [..]Payload impl blocks. · model-checking/verify-rust-std@224d45c (original) (raw)
`@@ -597,11 +597,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
`
597
597
`string: Option,
`
598
598
`}
`
599
599
``
600
``
`-
impl<'a> FormatStringPayload<'a> {
`
601
``
`-
fn new(inner: &'a fmt::Arguments<'a>) -> Self {
`
602
``
`-
Self { inner, string: None }
`
603
``
`-
}
`
604
``
-
``
600
`+
impl FormatStringPayload<'_> {
`
605
601
`fn fill(&mut self) -> &mut String {
`
606
602
`use crate::fmt::Write;
`
607
603
``
`@@ -615,7 +611,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
`
615
611
`}
`
616
612
`}
`
617
613
``
618
``
`-
unsafe impl<'a> PanicPayload for FormatStringPayload<'a> {
`
``
614
`+
unsafe impl PanicPayload for FormatStringPayload<'_> {
`
619
615
`fn take_box(&mut self) -> *mut (dyn Any + Send) {
`
620
616
`// We do two allocations here, unfortunately. But (a) they're required with the current
`
621
617
`// 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<'_>) -> ! {
`
654
650
`);
`
655
651
`} else {
`
656
652
`rust_panic_with_hook(
`
657
``
`-
&mut FormatStringPayload::new(&msg),
`
``
653
`+
&mut FormatStringPayload { inner: &msg, string: None },
`
658
654
`Some(msg),
`
659
655
` loc,
`
660
656
` info.can_unwind(),
`