From efea79ca80289be333bf6052015c645b19a32132 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Thu, 1 Dec 2022 11:16:18 +0100 Subject: [PATCH] Gate macros behind `#[cfg(not(bootstrap))]` Co-authored-by: Takayuki Maeda --- library/core/src/macros/mod.rs | 11 ----------- library/core/src/prelude/v1.rs | 1 + library/std/src/prelude/v1.rs | 1 + 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 0cd9426209fd..f29cd357d6bf 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -1558,17 +1558,6 @@ pub(crate) mod builtin { /* compiler built-in */ } - /// Unstable placeholder for type ascription. - #[unstable( - feature = "type_ascription", - issue = "23416", - reason = "placeholder syntax for type ascription" - )] - #[cfg(bootstrap)] - pub macro type_ascribe($expr:expr, $ty:ty) { - $expr: $ty - } - /// Unstable implementation detail of the `rustc` compiler, do not use. #[rustc_builtin_macro] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/core/src/prelude/v1.rs b/library/core/src/prelude/v1.rs index a28d14b14a8e..2d67d742c689 100644 --- a/library/core/src/prelude/v1.rs +++ b/library/core/src/prelude/v1.rs @@ -104,4 +104,5 @@ pub use crate::macros::builtin::cfg_eval; issue = "23416", reason = "placeholder syntax for type ascription" )] +#[cfg(not(bootstrap))] pub use crate::macros::builtin::type_ascribe; diff --git a/library/std/src/prelude/v1.rs b/library/std/src/prelude/v1.rs index 4ab4229598ec..a5a798078eb9 100644 --- a/library/std/src/prelude/v1.rs +++ b/library/std/src/prelude/v1.rs @@ -91,6 +91,7 @@ pub use core::prelude::v1::cfg_eval; issue = "23416", reason = "placeholder syntax for type ascription" )] +#[cfg(not(bootstrap))] pub use core::prelude::v1::type_ascribe; // The file so far is equivalent to src/libcore/prelude/v1.rs,