We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44c343b commit 3f0b766Copy full SHA for 3f0b766
src/libstd/macros.rs
@@ -288,14 +288,17 @@ pub mod builtin {
288
/// # Examples
289
/// Two such examples are macros and `#[cfg]` environments.
290
///
291
- /// ```
+ /// ```compile_fail
292
/// macro_rules! give_me_foo_or_bar {
293
/// (foo) => {};
294
/// (bar) => {};
295
/// ($x:ident) => {
296
/// compile_error!("This macro only accepts `foo` or `bar`");
297
/// }
298
299
+ ///
300
+ /// give_me_foo_or_bar!(neither);
301
+ /// // ^ will fail at compile time with message "This macro only accepts `foo` or `bar`"
302
/// ```
303
304
/// ```compile_fail
0 commit comments