From f85ddfbc3f25b73d41aa9db332dcd72bf70cd985 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Tue, 29 May 2018 10:07:14 +0200 Subject: [PATCH] Add sentence to compile_error!() docs It now details why using compile_error!() is different from just not having the final macro_rules!() branch. --- src/libstd/macros.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 935102f8355..75f038407c1 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -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 {