diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 19:01:17 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 19:01:17 -0800 |
| commit | 7975fd9cee750f26f9f6ef85b92a20b24ee24120 (patch) | |
| tree | 0c36840cd8bf89ad1f662ed81d8e71c93e22c41e /src/liblog | |
| parent | 563f6d8218cf15bf2590507c38ce4cbb734d6bba (diff) | |
| parent | 78e841d8b10e05b5bbad4b02a9d5f0e9611100c7 (diff) | |
| download | rust-7975fd9cee750f26f9f6ef85b92a20b24ee24120.tar.gz rust-7975fd9cee750f26f9f6ef85b92a20b24ee24120.zip | |
rollup merge of #20482: kmcallister/macro-reform
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
Diffstat (limited to 'src/liblog')
| -rw-r--r-- | src/liblog/lib.rs | 6 | ||||
| -rw-r--r-- | src/liblog/macros.rs | 20 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 0508402ff19..df85e89efd1 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -13,8 +13,7 @@ //! # Examples //! //! ``` -//! #![feature(phase)] -//! #[phase(plugin, link)] extern crate log; +//! #[macro_use] extern crate log; //! //! fn main() { //! debug!("this is a debug {}", "message"); @@ -183,7 +182,10 @@ use regex::Regex; use directive::LOG_LEVEL_NAMES; +#[cfg_attr(stage0, macro_escape)] +#[cfg_attr(not(stage0), macro_use)] pub mod macros; + mod directive; /// Maximum logging level of a module that can be specified. Common logging diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs index f41a4a8b901..5c7085b7b6c 100644 --- a/src/liblog/macros.rs +++ b/src/liblog/macros.rs @@ -10,8 +10,6 @@ //! Logging macros -#![macro_escape] - /// The standard logging macro /// /// This macro will generically log over a provided level (of type u32) with a @@ -21,8 +19,7 @@ /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// log!(log::WARN, "this is a warning {}", "message"); @@ -70,8 +67,7 @@ macro_rules! log { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let error = 3u; @@ -96,8 +92,7 @@ macro_rules! error { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let code = 3u; @@ -121,8 +116,7 @@ macro_rules! warn { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// let ret = 3; @@ -148,8 +142,7 @@ macro_rules! info { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// fn main() { /// debug!("x = {x}, y = {y}", x=10, y=20); @@ -172,8 +165,7 @@ macro_rules! debug { /// # Example /// /// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; +/// #[macro_use] extern crate log; /// /// struct Point { x: int, y: int } /// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } } |
