diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2025-07-03 22:57:06 -0700 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2025-07-05 16:23:13 -0700 |
| commit | 0d5ab3e46ce3be1e5e3c45ac0ff7d355303c4353 (patch) | |
| tree | 82186b46ed4f8afe24c7adde4ad8c9b337bee0c4 | |
| parent | a7382eae3fccb2db5353640454c5d09840d3089e (diff) | |
| download | rust-0d5ab3e46ce3be1e5e3c45ac0ff7d355303c4353.tar.gz rust-0d5ab3e46ce3be1e5e3c45ac0ff7d355303c4353.zip | |
mbe: Simplify a match to a let-else
| -rw-r--r-- | compiler/rustc_expand/src/mbe/macro_rules.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 44201d48147..731a4a08ab0 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -213,9 +213,8 @@ fn expand_macro<'cx>( match try_success_result { Ok((i, named_matches)) => { - let (rhs, rhs_span): (&mbe::Delimited, DelimSpan) = match &rhses[i] { - mbe::TokenTree::Delimited(span, _, delimited) => (&delimited, *span), - _ => cx.dcx().span_bug(sp, "malformed macro rhs"), + let mbe::TokenTree::Delimited(rhs_span, _, ref rhs) = rhses[i] else { + cx.dcx().span_bug(sp, "malformed macro rhs"); }; let arm_span = rhses[i].span(); |
