mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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:
commit
335c887721
@ -252,8 +252,6 @@ macro_rules! debug_assert_ne {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(matches_macro)]
|
||||
///
|
||||
/// let foo = 'f';
|
||||
/// assert!(matches!(foo, 'A'..='Z' | 'a'..='z'));
|
||||
///
|
||||
@ -261,7 +259,7 @@ macro_rules! debug_assert_ne {
|
||||
/// 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 {
|
||||
|
@ -15,7 +15,6 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(nll)]
|
||||
#![feature(matches_macro)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
#[macro_use]
|
||||
|
@ -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]
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user