about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/macros/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/macros/mod.rs b/src/libcore/macros/mod.rs
index 18d5eaa9648..8de6be86e34 100644
--- a/src/libcore/macros/mod.rs
+++ b/src/libcore/macros/mod.rs
@@ -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, this means all code in an if/else block needs 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