1
Fork 0

Shorten lifetime of even more panic temporaries

This commit is contained in:
David Tolnay 2023-05-15 01:14:57 -07:00
parent 0ebb5cbab6
commit 2f5d993945
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 14 additions and 14 deletions

View file

@ -19,11 +19,11 @@ pub macro panic_2015 {
$crate::rt::begin_panic("explicit panic")
}),
($msg:expr $(,)?) => ({
$crate::rt::begin_panic($msg)
$crate::rt::begin_panic($msg);
}),
// Special-case the single-argument case for const_panic.
("{}", $arg:expr $(,)?) => ({
$crate::rt::panic_display(&$arg)
$crate::rt::panic_display(&$arg);
}),
($fmt:expr, $($arg:tt)+) => ({
// Semicolon to prevent temporaries inside the formatting machinery from