mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: Fix pat fragment handling in 2021 edition
This commit is contained in:
parent
5750d81e30
commit
d1ca505525
8 changed files with 80 additions and 23 deletions
|
@ -13,10 +13,11 @@ use crate::{parser::MetaVarKind, tt, ExpandError, ExpandResult};
|
|||
pub(crate) fn expand_rules(
|
||||
rules: &[crate::Rule],
|
||||
input: &tt::Subtree,
|
||||
is_2021: bool,
|
||||
) -> ExpandResult<tt::Subtree> {
|
||||
let mut match_: Option<(matcher::Match, &crate::Rule)> = None;
|
||||
for rule in rules {
|
||||
let new_match = matcher::match_(&rule.lhs, input);
|
||||
let new_match = matcher::match_(&rule.lhs, input, is_2021);
|
||||
|
||||
if new_match.err.is_none() {
|
||||
// If we find a rule that applies without errors, we're done.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue