From 5bf385be6a5ce267ac7cd9d1725178488e33131c Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 18 Dec 2014 20:48:26 -0800 Subject: Rename macro_escape to macro_use In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now. --- src/libstd/io/mod.rs | 3 ++- src/libstd/lib.rs | 21 ++++++++++++++------- src/libstd/rt/mod.rs | 2 ++ src/libstd/thread_local/mod.rs | 3 ++- 4 files changed, 20 insertions(+), 9 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index bf373a145e4..e9386c30a6d 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -285,7 +285,8 @@ pub mod stdio; pub mod timer; pub mod util; -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod test; /// The default buffer size for various I/O operations diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5ffd3ebc7ad..abe968849c2 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -173,14 +173,17 @@ pub use unicode::char; /* Exported macros */ #[cfg(stage0)] -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod macros_stage0; #[cfg(not(stage0))] -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod macros; -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod bitflags; mod rtdeps; @@ -193,15 +196,18 @@ pub mod prelude; /* Primitive types */ #[path = "num/float_macros.rs"] -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] mod float_macros; #[path = "num/int_macros.rs"] -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] mod int_macros; #[path = "num/uint_macros.rs"] -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] mod uint_macros; #[path = "num/int.rs"] pub mod int; @@ -229,7 +235,8 @@ pub mod num; /* Runtime and platform support */ -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod thread_local; pub mod c_str; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 2b0639c5705..e556888a470 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -39,6 +39,8 @@ pub use alloc::heap; pub mod backtrace; // Internals +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] mod macros; // These should be refactored/moved/made private over time diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 1ed01c034b5..e0cbaa8ca50 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -40,7 +40,8 @@ use prelude::v1::*; use cell::UnsafeCell; -#[macro_escape] +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod scoped; // Sure wish we had macro hygiene, no? -- cgit 1.4.1-3-g733a5