From dd262e385646fa94b85b5340f260efb01284261b Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 18 Oct 2020 23:45:20 +0200 Subject: [PATCH] Add cfg(not(bootstrap)) on the new rustc_diagnostic_item attributes. The beta compiler doesn't accept rustc_diagnostic_items on macros yet. --- library/core/src/macros/mod.rs | 4 ++-- library/std/src/macros.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 53e6b459839..54bbedcd914 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -2,7 +2,7 @@ #[macro_export] #[allow_internal_unstable(core_panic, const_caller_location)] #[stable(feature = "core", since = "1.6.0")] -#[rustc_diagnostic_item = "core_panic_macro"] +#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "core_panic_macro")] macro_rules! panic { () => ( $crate::panic!("explicit panic") @@ -1216,7 +1216,7 @@ macro_rules! include { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_builtin_macro] #[macro_export] - #[rustc_diagnostic_item = "assert_macro"] + #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "assert_macro")] #[allow_internal_unstable(core_panic)] macro_rules! assert { ($cond:expr $(,)?) => {{ /* compiler built-in */ }}; diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index d003dd9fe84..f34eea1f8ac 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -8,7 +8,7 @@ #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] #[allow_internal_unstable(libstd_sys_internals)] -#[rustc_diagnostic_item = "std_panic_macro"] +#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "std_panic_macro")] macro_rules! panic { () => ({ $crate::panic!("explicit panic") }); ($msg:expr $(,)?) => ({ $crate::rt::begin_panic($msg) });