@@ -28,13 +28,13 @@ pub macro panic_2015 {
2828 $crate:: panicking:: panic ( $msg)
2929 ) ,
3030 // Use `panic_str` instead of `panic_display::<&str>` for non_fmt_panic lint.
31- ( $msg: expr $( , ) ?) => (
32- $crate:: panicking:: panic_str ( $msg)
33- ) ,
31+ ( $msg: expr $( , ) ?) => ( {
32+ $crate:: panicking:: panic_str ( $msg) ;
33+ } ) ,
3434 // Special-case the single-argument case for const_panic.
35- ( "{}" , $arg: expr $( , ) ?) => (
36- $crate:: panicking:: panic_display ( & $arg)
37- ) ,
35+ ( "{}" , $arg: expr $( , ) ?) => ( {
36+ $crate:: panicking:: panic_display ( & $arg) ;
37+ } ) ,
3838 ( $fmt: expr, $( $arg: tt) +) => ( {
3939 // Semicolon to prevent temporaries inside the formatting machinery from
4040 // being considered alive in the caller after the panic_fmt call.
@@ -52,9 +52,9 @@ pub macro panic_2021 {
5252 $crate:: panicking:: panic ( "explicit panic" )
5353 ) ,
5454 // Special-case the single-argument case for const_panic.
55- ( "{}" , $arg: expr $( , ) ?) => (
56- $crate:: panicking:: panic_display ( & $arg)
57- ) ,
55+ ( "{}" , $arg: expr $( , ) ?) => ( {
56+ $crate:: panicking:: panic_display ( & $arg) ;
57+ } ) ,
5858 ( $( $t: tt) +) => ( {
5959 // Semicolon to prevent temporaries inside the formatting machinery from
6060 // being considered alive in the caller after the panic_fmt call.
@@ -73,9 +73,9 @@ pub macro unreachable_2015 {
7373 ) ,
7474 // Use of `unreachable_display` for non_fmt_panic lint.
7575 // NOTE: the message ("internal error ...") is embedded directly in unreachable_display
76- ( $msg: expr $( , ) ?) => (
77- $crate:: panicking:: unreachable_display ( & $msg)
78- ) ,
76+ ( $msg: expr $( , ) ?) => ( {
77+ $crate:: panicking:: unreachable_display ( & $msg) ;
78+ } ) ,
7979 ( $fmt: expr, $( $arg: tt) * ) => (
8080 $crate:: panic!( $crate :: concat!( "internal error: entered unreachable code: " , $fmt) , $( $arg) * )
8181 ) ,
0 commit comments