Skip to content

Commit aaaea2c

Browse files
committed
compile_error example blurbs
1 parent 3f0b766 commit aaaea2c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libstd/macros.rs

+5
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,11 @@ pub mod builtin {
286286
/// better error messages for errornous conditions.
287287
///
288288
/// # Examples
289+
///
289290
/// Two such examples are macros and `#[cfg]` environments.
290291
///
292+
/// Emit better compiler error if a macro is passed invalid values.
293+
///
291294
/// ```compile_fail
292295
/// macro_rules! give_me_foo_or_bar {
293296
/// (foo) => {};
@@ -301,6 +304,8 @@ pub mod builtin {
301304
/// // ^ will fail at compile time with message "This macro only accepts `foo` or `bar`"
302305
/// ```
303306
///
307+
/// Emit compiler error if one of a number of features isn't available.
308+
///
304309
/// ```compile_fail
305310
/// #[cfg(not(any(feature = "foo", feature = "bar")))]
306311
/// compile_error!("Either feature \"foo\" or \"bar\" must be enabled for this crate.")

0 commit comments

Comments
 (0)