mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +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
|
@ -20,7 +20,10 @@ fn benchmark_parse_macro_rules() {
|
|||
let rules = macro_rules_fixtures_tt();
|
||||
let hash: usize = {
|
||||
let _pt = bench("mbe parse macro rules");
|
||||
rules.values().map(|it| DeclarativeMacro::parse_macro_rules(it).unwrap().rules.len()).sum()
|
||||
rules
|
||||
.values()
|
||||
.map(|it| DeclarativeMacro::parse_macro_rules(it, true).unwrap().rules.len())
|
||||
.sum()
|
||||
};
|
||||
assert_eq!(hash, 1144);
|
||||
}
|
||||
|
@ -50,7 +53,7 @@ fn benchmark_expand_macro_rules() {
|
|||
fn macro_rules_fixtures() -> FxHashMap<String, DeclarativeMacro> {
|
||||
macro_rules_fixtures_tt()
|
||||
.into_iter()
|
||||
.map(|(id, tt)| (id, DeclarativeMacro::parse_macro_rules(&tt).unwrap()))
|
||||
.map(|(id, tt)| (id, DeclarativeMacro::parse_macro_rules(&tt, true).unwrap()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue