mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Enable parsing of attributes inside a match block
We allow invalid inner attributes to be parsed, e.g. inner attributes that are not directly after the opening brace of the match block. Instead we run validation on `MatchArmList` to allow better reporting of errors.
This commit is contained in:
parent
982f72c022
commit
1c97c1ac11
16 changed files with 589 additions and 1 deletions
|
@ -1946,6 +1946,7 @@ impl ToOwned for MatchArm {
|
|||
}
|
||||
|
||||
|
||||
impl ast::AttrsOwner for MatchArm {}
|
||||
impl MatchArm {
|
||||
pub fn pats(&self) -> impl Iterator<Item = &Pat> {
|
||||
super::children(self)
|
||||
|
@ -1986,6 +1987,7 @@ impl ToOwned for MatchArmList {
|
|||
}
|
||||
|
||||
|
||||
impl ast::AttrsOwner for MatchArmList {}
|
||||
impl MatchArmList {
|
||||
pub fn arms(&self) -> impl Iterator<Item = &MatchArm> {
|
||||
super::children(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue