diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-03-19 15:33:56 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-19 15:33:56 +0530 |
| commit | acaae90bf5485e1238f0953c5b087772d9045284 (patch) | |
| tree | a9bd244d04f927057b312f5d0fb58963ff2f64d0 /library/core/src | |
| parent | e458a7949ffa5fe4280fcf7cae4daf6ff80269c9 (diff) | |
| parent | dfe4c49e9b8f724d43328eee46b733f65d3d5b25 (diff) | |
| download | rust-acaae90bf5485e1238f0953c5b087772d9045284.tar.gz rust-acaae90bf5485e1238f0953c5b087772d9045284.zip | |
Rollup merge of #108829 - xfix:use-edition-2021-pat-in-matches, r=Mark-Simulacrum
Use Edition 2021 :pat in matches macro This makes the macro syntax used in documentation more readable.
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/macros/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 3b026bc0e0f..529f62f4d6c 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -340,9 +340,9 @@ pub macro debug_assert_matches($($arg:tt)*) { #[stable(feature = "matches_macro", since = "1.42.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "matches_macro")] macro_rules! matches { - ($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => { + ($expression:expr, $pattern:pat $(if $guard:expr)? $(,)?) => { match $expression { - $( $pattern )|+ $( if $guard )? => true, + $pattern $(if $guard)? => true, _ => false } }; |
