|
19 | 19 | // SNAP 5520801
|
20 | 20 | #[cfg(stage0)]
|
21 | 21 | #[macro_export]
|
22 |
| -macro_rules! ensure_not_fmt_string_literal { |
23 |
| - ($name:expr, $e:expr) => { $e } |
| 22 | +macro_rules! __unstable_rustc_ensure_not_fmt_string_literal { |
| 23 | + ($name:expr, $e:expr) => { ((), $e) } |
24 | 24 | }
|
25 | 25 |
|
26 | 26 | /// The entry point for panic of Rust tasks.
|
@@ -51,7 +51,8 @@ macro_rules! panic {
|
51 | 51 | panic!("explicit panic")
|
52 | 52 | });
|
53 | 53 | ($msg:expr) => ({
|
54 |
| - $crate::rt::begin_unwind(ensure_not_fmt_string_literal!("panic!", $msg), { |
| 54 | + $crate::rt::begin_unwind( |
| 55 | + __unstable_rustc_ensure_not_fmt_string_literal!("unary `panic!`", $msg).1, { |
55 | 56 | // static requires less code at runtime, more constant data
|
56 | 57 | static _FILE_LINE: (&'static str, usize) = (file!(), line!() as usize);
|
57 | 58 | &_FILE_LINE
|
@@ -97,11 +98,12 @@ macro_rules! panic {
|
97 | 98 | panic!("explicit panic")
|
98 | 99 | });
|
99 | 100 | ($msg:expr) => ({
|
100 |
| - $crate::rt::begin_unwind($msg, { |
101 |
| - // static requires less code at runtime, more constant data |
102 |
| - static _FILE_LINE: (&'static str, u32) = (file!(), line!()); |
103 |
| - &_FILE_LINE |
104 |
| - }) |
| 101 | + $crate::rt::begin_unwind( |
| 102 | + __unstable_rustc_ensure_not_fmt_string_literal!("unary `panic!`", $msg), { |
| 103 | + // static requires less code at runtime, more constant data |
| 104 | + static _FILE_LINE: (&'static str, u32) = (file!(), line!()); |
| 105 | + &_FILE_LINE |
| 106 | + }) |
105 | 107 | });
|
106 | 108 | ($fmt:expr, $($arg:tt)+) => ({
|
107 | 109 | $crate::rt::begin_unwind_fmt(format_args!($fmt, $($arg)+), {
|
|
0 commit comments