File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ macro_rules! cfg_if {
8282/// Similar to [`cfg_if`](cfg_if), but accepts a list of expressions, and generates an internal
8383/// closure to return each value.
8484///
85+ /// The main reason this is necessary is because attaching `#[cfg(...)]` annotations to certain
86+ /// types of statements requires a nightly feature, or `cfg_if` would be enough on its own. This
87+ /// macro's restricted interface allows it to generate a closure as a circumlocution that is legal
88+ /// on stable rust.
89+ ///
90+ /// Note that any `return` operation within the expressions provided to this macro will apply to the
91+ /// generated closure, not the enclosing scope--it cannot be used to interfere with external
92+ /// control flow.
93+ ///
8594/// The generated closure is non-[`const`](const@keyword), so cannot be used inside `const` methods.
8695#[ doc( hidden) ]
8796#[ macro_export]
You can’t perform that action at this time.
0 commit comments