Skip to content

Commit f85ddfb

Browse files
oghampietroalbini
authored andcommitted
Add sentence to compile_error!() docs
It now details why using compile_error!() is different from just not having the final macro_rules!() branch.
1 parent 2d3c369 commit f85ddfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libstd/macros.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ pub mod builtin {
315315
///
316316
/// Two such examples are macros and `#[cfg]` environments.
317317
///
318-
/// Emit better compiler error if a macro is passed invalid values.
318+
/// Emit better compiler error if a macro is passed invalid values. Without the final branch,
319+
/// the compiler would still emit an error, but the error's message would not mention the two
320+
/// valid values.
319321
///
320322
/// ```compile_fail
321323
/// macro_rules! give_me_foo_or_bar {

0 commit comments

Comments
 (0)