Rollup merge of #67659 - SimonSapin:matches, r=rkruppe

Stabilize the `matches!` macro

Fixes https://github.com/rust-lang/rust/issues/65721

FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
This commit is contained in:
Oliver Scherer 2019-12-28 00:36:17 +01:00 committed by GitHub
commit 335c887721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 7 deletions

View File

@ -252,8 +252,6 @@ macro_rules! debug_assert_ne {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(matches_macro)]
///
/// let foo = 'f'; /// let foo = 'f';
/// assert!(matches!(foo, 'A'..='Z' | 'a'..='z')); /// assert!(matches!(foo, 'A'..='Z' | 'a'..='z'));
/// ///
@ -261,7 +259,7 @@ macro_rules! debug_assert_ne {
/// assert!(matches!(bar, Some(x) if x > 2)); /// assert!(matches!(bar, Some(x) if x > 2));
/// ``` /// ```
#[macro_export] #[macro_export]
#[unstable(feature = "matches_macro", issue = "65721")] #[stable(feature = "matches_macro", since = "1.42.0")]
macro_rules! matches { macro_rules! matches {
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => { ($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
match $expression { match $expression {

View File

@ -15,7 +15,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(nll)] #![feature(nll)]
#![feature(matches_macro)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#[macro_use] #[macro_use]

View File

@ -29,7 +29,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(range_is_empty)] #![feature(range_is_empty)]
#![feature(stmt_expr_attributes)] #![feature(stmt_expr_attributes)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(matches_macro)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#[macro_use] #[macro_use]

View File

@ -277,7 +277,6 @@
#![feature(linkage)] #![feature(linkage)]
#![feature(log_syntax)] #![feature(log_syntax)]
#![feature(manually_drop_take)] #![feature(manually_drop_take)]
#![feature(matches_macro)]
#![feature(maybe_uninit_ref)] #![feature(maybe_uninit_ref)]
#![feature(maybe_uninit_slice)] #![feature(maybe_uninit_slice)]
#![feature(needs_panic_runtime)] #![feature(needs_panic_runtime)]

View File

@ -11,7 +11,6 @@
#![feature(const_transmute)] #![feature(const_transmute)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![feature(matches_macro)]
#![feature(nll)] #![feature(nll)]
#![feature(try_trait)] #![feature(try_trait)]
#![feature(slice_patterns)] #![feature(slice_patterns)]