38
38
/// The multi-argument form of this macro panics with a string and has the
39
39
/// [`format!`] syntax for building a string.
40
40
///
41
+ /// See also the macro [`compile_error!`], for raising errors during compilation.
42
+ ///
41
43
/// [runwrap]: ../std/result/enum.Result.html#method.unwrap
42
44
/// [`Option`]: ../std/option/enum.Option.html#method.unwrap
43
45
/// [`Result`]: ../std/result/enum.Result.html
44
46
/// [`format!`]: ../std/macro.format.html
47
+ /// [`compile_error!`]: ../std/macro.compile_error.html
45
48
/// [book]: ../book/second-edition/ch09-01-unrecoverable-errors-with-panic.html
46
49
///
47
50
/// # Current implementation
@@ -305,7 +308,8 @@ pub mod builtin {
305
308
/// Unconditionally causes compilation to fail with the given error message when encountered.
306
309
///
307
310
/// This macro should be used when a crate uses a conditional compilation strategy to provide
308
- /// better error messages for erroneous conditions.
311
+ /// better error messages for erroneous conditions. It's the compiler-level form of [`panic!`],
312
+ /// which emits an error at *runtime*, rather than during compilation.
309
313
///
310
314
/// # Examples
311
315
///
@@ -332,6 +336,8 @@ pub mod builtin {
332
336
/// #[cfg(not(any(feature = "foo", feature = "bar")))]
333
337
/// compile_error!("Either feature \"foo\" or \"bar\" must be enabled for this crate.")
334
338
/// ```
339
+ ///
340
+ /// [`panic!`]: ../std/macro.panic.html
335
341
#[ stable( feature = "compile_error_macro" , since = "1.20.0" ) ]
336
342
#[ macro_export]
337
343
macro_rules! compile_error {
0 commit comments