Skip to content

Commit

Permalink
Add sentence to compile_error!() docs
Browse files Browse the repository at this point in the history
It now details why using compile_error!() is different from just not having the final macro_rules!() branch.
  • Loading branch information
ogham authored and pietroalbini committed Jun 25, 2018
1 parent 2d3c369 commit f85ddfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libstd/macros.rs
Expand Up @@ -315,7 +315,9 @@ pub mod builtin {
///
/// Two such examples are macros and `#[cfg]` environments.
///
/// Emit better compiler error if a macro is passed invalid values.
/// Emit better compiler error if a macro is passed invalid values. Without the final branch,
/// the compiler would still emit an error, but the error's message would not mention the two
/// valid values.
///
/// ```compile_fail
/// macro_rules! give_me_foo_or_bar {
Expand Down

0 comments on commit f85ddfb

Please sign in to comment.