diff options
| author | Havvy <ryan.havvy@gmail.com> | 2017-12-05 01:47:47 -0800 |
|---|---|---|
| committer | Havvy <ryan.havvy@gmail.com> | 2017-12-05 01:47:47 -0800 |
| commit | 3f0b766c35f6822f1f69ec23630496bbe11a707f (patch) | |
| tree | 1c220f765dcd1e4a26ceb5cd25faf9bf16800c8b /src/libstd | |
| parent | 44c343be45ef0ef68f456eeb8f5a07fa46eb599b (diff) | |
No unused macro warning in compile_error example.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 85785270811..e2028883f23 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -288,7 +288,7 @@ pub mod builtin { /// # Examples /// Two such examples are macros and `#[cfg]` environments. /// - /// ``` + /// ```compile_fail /// macro_rules! give_me_foo_or_bar { /// (foo) => {}; /// (bar) => {}; @@ -296,6 +296,9 @@ pub mod builtin { /// compile_error!("This macro only accepts `foo` or `bar`"); /// } /// } + /// + /// give_me_foo_or_bar!(neither); + /// // ^ will fail at compile time with message "This macro only accepts `foo` or `bar`" /// ``` /// /// ```compile_fail |
