mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fix parse tree of attribute on match arm
This commit is contained in:
parent
aea9c98f53
commit
a67fe4ea7e
4 changed files with 133 additions and 133 deletions
|
@ -342,21 +342,6 @@ pub(crate) fn match_arm_list(p: &mut Parser) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// test match_arms_outer_attributes
|
||||
// fn foo() {
|
||||
// match () {
|
||||
// #[cfg(feature = "some")]
|
||||
// _ => (),
|
||||
// #[cfg(feature = "other")]
|
||||
// _ => (),
|
||||
// #[cfg(feature = "many")]
|
||||
// #[cfg(feature = "attributes")]
|
||||
// #[cfg(feature = "before")]
|
||||
// _ => (),
|
||||
// }
|
||||
// }
|
||||
attributes::outer_attributes(p);
|
||||
|
||||
// test match_arms_commas
|
||||
// fn foo() {
|
||||
// match () {
|
||||
|
@ -387,6 +372,21 @@ pub(crate) fn match_arm_list(p: &mut Parser) {
|
|||
// }
|
||||
fn match_arm(p: &mut Parser) -> BlockLike {
|
||||
let m = p.start();
|
||||
// test match_arms_outer_attributes
|
||||
// fn foo() {
|
||||
// match () {
|
||||
// #[cfg(feature = "some")]
|
||||
// _ => (),
|
||||
// #[cfg(feature = "other")]
|
||||
// _ => (),
|
||||
// #[cfg(feature = "many")]
|
||||
// #[cfg(feature = "attributes")]
|
||||
// #[cfg(feature = "before")]
|
||||
// _ => (),
|
||||
// }
|
||||
// }
|
||||
attributes::outer_attributes(p);
|
||||
|
||||
patterns::pattern_list_r(p, TokenSet::empty());
|
||||
if p.at(IF_KW) {
|
||||
match_guard(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue