about summary refs log tree commit diff
path: root/src/libstd/macros.rs
diff options
context:
space:
mode:
authorWesley Wiser <wwiser@gmail.com>2017-05-06 23:26:45 -0400
committerWesley Wiser <wwiser@gmail.com>2017-06-19 14:29:12 -0400
commit0b29d26079f8e4bb76069b2e3d9c0d8e0f689acf (patch)
tree53e524cca7de63e864eee13fda137a3b6ffb285d /src/libstd/macros.rs
parent04145943a25c3b8c7e7d7fe8c2efb04f259c25fb (diff)
downloadrust-0b29d26079f8e4bb76069b2e3d9c0d8e0f689acf.tar.gz
rust-0b29d26079f8e4bb76069b2e3d9c0d8e0f689acf.zip
Add compile_error!
Related to #40872
Diffstat (limited to 'src/libstd/macros.rs')
-rw-r--r--src/libstd/macros.rs10
1 files changed, 10 insertions, 0 deletions
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