Skip to content

Commit

Permalink
Rollup merge of rust-lang#71692 - dfreese:cfgdocs, r=kennytm
Browse files Browse the repository at this point in the history
Add clarification on std::cfg macro docs v. #[cfg] attribute

The wording was discussed, to a limited degree in rust-lang#71679.  This tries to
address some confusion I as well as someone else had independently when
looking at this macro.

Fixes rust-lang#71679
  • Loading branch information
Dylan-DPC committed Apr 30, 2020
2 parents e2333a9 + 610f944 commit 8f6eabf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcore/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@ pub(crate) mod builtin {
/// The syntax given to this macro is the same syntax as the [`cfg`]
/// attribute.
///
/// `cfg!`, unlike `#[cfg]`, does not remove any code and only evaluates to true or false. For
/// example, all blocks in an if/else expression need to be valid when `cfg!` is used for
/// the condition, regardless of what `cfg!` is evaluating.
///
/// [`cfg`]: ../reference/conditional-compilation.html#the-cfg-attribute
///
/// # Examples
Expand Down

0 comments on commit 8f6eabf

Please sign in to comment.