Shorten lifetime of panic temporaries in panic_fmt case
This commit is contained in:
parent
cbee2a1ec4
commit
cb109a672d
5 changed files with 24 additions and 45 deletions
|
@ -26,7 +26,9 @@ pub macro panic_2015 {
|
|||
$crate::rt::panic_display(&$arg)
|
||||
}),
|
||||
($fmt:expr, $($arg:tt)+) => ({
|
||||
$crate::rt::panic_fmt($crate::const_format_args!($fmt, $($arg)+))
|
||||
// Semicolon to prevent temporaries inside the formatting machinery from
|
||||
// being considered alive in the caller after the panic_fmt call.
|
||||
$crate::rt::panic_fmt($crate::const_format_args!($fmt, $($arg)+));
|
||||
}),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue