No unused macro warning in compile_error example.
This commit is contained in:
@@ -288,7 +288,7 @@ pub mod builtin {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
/// Two such examples are macros and `#[cfg]` environments.
|
/// Two such examples are macros and `#[cfg]` environments.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```compile_fail
|
||||||
/// macro_rules! give_me_foo_or_bar {
|
/// macro_rules! give_me_foo_or_bar {
|
||||||
/// (foo) => {};
|
/// (foo) => {};
|
||||||
/// (bar) => {};
|
/// (bar) => {};
|
||||||
@@ -296,6 +296,9 @@ pub mod builtin {
|
|||||||
/// compile_error!("This macro only accepts `foo` or `bar`");
|
/// 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
|
/// ```compile_fail
|
||||||
|
|||||||
Reference in New Issue
Block a user