Skip to content

Commit

Permalink
Unrolled build for rust-lang#135625
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#135625 - c410-f3r:cfg-match-foo-bar-baz, r=tgross35,jhpratt

[cfg_match] Document the use of expressions.

cc rust-lang#115585

Adds documentation to this new feature introduced in rust-lang#133720.
  • Loading branch information
rust-timer authored Jan 29, 2025
2 parents 122fb29 + 7d9fe91 commit 88b4dc3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,17 @@ pub macro cfg_match {
/// }
/// }
/// ```
///
/// If desired, it is possible to return expressions through the use of surrounding braces:
///
/// ```
/// #![feature(cfg_match)]
///
/// let _some_string = cfg_match! {{
/// unix => { "With great power comes great electricity bills" }
/// _ => { "Behind every successful diet is an unwatched pizza" }
/// }};
/// ```
#[cfg(not(bootstrap))]
#[unstable(feature = "cfg_match", issue = "115585")]
#[rustc_diagnostic_item = "cfg_match"]
Expand Down

0 comments on commit 88b4dc3

Please sign in to comment.