diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 1634aff7b4dc9..be980c5f07b71 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -7,15 +7,15 @@ macro_rules! panic { () => ( $crate::panic!("explicit panic") ); - ($msg:literal $(,)?) => ( + ($msg:literal $(,)?) => ({ $crate::panicking::panic($msg) - ); - ($msg:expr $(,)?) => ( + }); + ($msg:expr $(,)?) => ({ $crate::panicking::panic_str($msg) - ); - ($fmt:expr, $($arg:tt)+) => ( + }); + ($fmt:expr, $($arg:tt)+) => ({ $crate::panicking::panic_fmt($crate::format_args!($fmt, $($arg)+)) - ); + }); } /// Asserts that two expressions are equal to each other (using [`PartialEq`]). diff --git a/src/test/ui/issues/issue-5500-1.rs b/src/test/ui/issues/issue-5500-1.rs index 98d6e1a14cb32..c2205c763af2a 100644 --- a/src/test/ui/issues/issue-5500-1.rs +++ b/src/test/ui/issues/issue-5500-1.rs @@ -11,5 +11,6 @@ struct TrieMapIterator<'a> { fn main() { let a = 5; let _iter = TrieMapIterator{node: &a}; - _iter.node = &panic!() + _iter.node = &panic!(); + _iter.node = &core::panic!() }