Skip to content

Commit 1d7a0df

Browse files
committed
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 11c39ac commit 1d7a0df

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
@@ -296,7 +296,9 @@ pub mod builtin {
296296
///
297297
/// Two such examples are macros and `#[cfg]` environments.
298298
///
299-
/// Emit better compiler error if a macro is passed invalid values.
299+
/// Emit better compiler error if a macro is passed invalid values. Without the final branch,
300+
/// the compiler would still emit an error, but the error's message would not mention the two
301+
/// valid values.
300302
///
301303
/// ```compile_fail
302304
/// macro_rules! give_me_foo_or_bar {

0 commit comments

Comments
 (0)