No unused macro warning in compile_error example.

This commit is contained in:
Havvy 2017-12-05 01:47:47 -08:00
parent 44c343be45
commit 3f0b766c35

View file

@ -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