Skip to content

Commit

Permalink
Rollup merge of rust-lang#67659 - SimonSapin:matches, r=rkruppe
Browse files Browse the repository at this point in the history
Stabilize the `matches!` macro

Fixes rust-lang#65721

FCP: rust-lang#65721 (comment)
  • Loading branch information
oli-obk authored Dec 27, 2019
2 parents 9eb45e3 + 1c572a2 commit 335c887
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions src/libcore/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,14 @@ macro_rules! debug_assert_ne {
/// # Examples
///
/// ```
/// #![feature(matches_macro)]
///
/// let foo = 'f';
/// assert!(matches!(foo, 'A'..='Z' | 'a'..='z'));
///
/// let bar = Some(4);
/// assert!(matches!(bar, Some(x) if x > 2));
/// ```
#[macro_export]
#[unstable(feature = "matches_macro", issue = "65721")]
#[stable(feature = "matches_macro", since = "1.42.0")]
macro_rules! matches {
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
match $expression {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(nll)]
#![feature(matches_macro)]
#![recursion_limit = "256"]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(range_is_empty)]
#![feature(stmt_expr_attributes)]
#![feature(trait_alias)]
#![feature(matches_macro)]
#![recursion_limit = "256"]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
#![feature(linkage)]
#![feature(log_syntax)]
#![feature(manually_drop_take)]
#![feature(matches_macro)]
#![feature(maybe_uninit_ref)]
#![feature(maybe_uninit_slice)]
#![feature(needs_panic_runtime)]
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#![feature(const_transmute)]
#![feature(crate_visibility_modifier)]
#![feature(label_break_value)]
#![feature(matches_macro)]
#![feature(nll)]
#![feature(try_trait)]
#![feature(slice_patterns)]
Expand Down

0 comments on commit 335c887

Please sign in to comment.