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:
Ville Penttinen 2019-02-17 19:08:34 +02:00
parent 982f72c022
commit 1c97c1ac11
16 changed files with 589 additions and 1 deletions

View file

@ -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)