diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-06-21 10:40:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-21 10:40:15 -0400 |
| commit | d33e2c5181488c15b14a48bd84dec8b28049dd33 (patch) | |
| tree | 57f627cb4bed95e8643337472050d072fe67f657 /src/libstd | |
| parent | 292fcc880fb851d0d582c0bc5a266c77b104fd8b (diff) | |
| parent | 2bec12f03695792998dbbb79bcee02ecfe0cf8f1 (diff) | |
| download | rust-d33e2c5181488c15b14a48bd84dec8b28049dd33.tar.gz rust-d33e2c5181488c15b14a48bd84dec8b28049dd33.zip | |
Rollup merge of #42620 - wesleywiser:compile_error, r=brson
Add compile_error! Related to #40872
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 10 |
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 |
