From 0b29d26079f8e4bb76069b2e3d9c0d8e0f689acf Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Sat, 6 May 2017 23:26:45 -0400 Subject: Add compile_error! Related to #40872 --- src/libstd/macros.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 496c014f70e..82c4f0830a6 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -238,6 +238,16 @@ macro_rules! assert_approx_eq { /// into libsyntax itself. #[cfg(dox)] pub mod builtin { + + /// Unconditionally causes compilation to fail with the given error message when encountered. + /// + /// For more information, see the [RFC]. + /// + /// [RFC]: https://github.com/rust-lang/rfcs/blob/master/text/1695-add-error-macro.md + #[unstable(feature = "compile_error_macro", issue = "40872")] + #[macro_export] + macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }) } + /// The core macro for formatted string creation & output. /// /// This macro produces a value of type [`fmt::Arguments`]. This value can be -- cgit 1.4.1-3-g733a5