diff options
| author | bors <bors@rust-lang.org> | 2015-11-30 21:15:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-30 21:15:56 +0000 |
| commit | 7269f0e9f35bffdffe75e21f9ea141f261c08bf5 (patch) | |
| tree | 9706a6291fb50d2df9faab7db77f32375e804376 | |
| parent | 7fa4d998dfba222821ef581f51039c5eb785839e (diff) | |
| parent | f18bfb3168659979f486618696127bb5e0f340dc (diff) | |
| download | rust-7269f0e9f35bffdffe75e21f9ea141f261c08bf5.tar.gz rust-7269f0e9f35bffdffe75e21f9ea141f261c08bf5.zip | |
Auto merge of #30080 - durka:patch-10, r=alexcrichton
Fixes #30073. The input to `cfg!` is a meta attribute, but not _any_ meta attribute (e.g. `cfg!(allow(dead_code))` doesn't compile). But the macro_rules syntax can't quite express this, so I added a note to the doc.
| -rw-r--r-- | src/libstd/macros.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index efeb59b4ac7..7a1ab790b0b 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -472,8 +472,8 @@ pub mod builtin { /// boolean expression evaluation of configuration flags. This frequently /// leads to less duplicated code. /// - /// The syntax given to this macro is the same syntax as the `cfg` - /// attribute. + /// The syntax given to this macro is the same syntax as [the `cfg` + /// attribute](../reference.html#conditional-compilation). /// /// # Examples /// @@ -486,7 +486,7 @@ pub mod builtin { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[macro_export] - macro_rules! cfg { ($cfg:tt) => ({ /* compiler built-in */ }) } + macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) } /// Parse the current given file as an expression. /// @@ -501,5 +501,5 @@ pub mod builtin { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[macro_export] - macro_rules! include { ($cfg:tt) => ({ /* compiler built-in */ }) } + macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }) } } |
