]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/expr.rs
Recover from a misplaced inner doc comment
[rust.git] / compiler / rustc_parse / src / parser / expr.rs
index 88ebf4aca23749ffc96759f71eed9847b83ba775..9dff40ff1ed6eae2f310b21499ad2a17b3781e3f 100644 (file)
@@ -1945,7 +1945,7 @@ fn eat_label(&mut self) -> Option<Label> {
     }
 
     /// Parses a `match ... { ... }` expression (`match` token already eaten).
-    fn parse_match_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>> {
+    fn parse_match_expr(&mut self, mut attrs: AttrVec) -> PResult<'a, P<Expr>> {
         let match_span = self.prev_token.span;
         let lo = self.prev_token.span;
         let scrutinee = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?;
@@ -1960,6 +1960,7 @@ fn parse_match_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>> {
             }
             return Err(e);
         }
+        attrs.extend(self.parse_inner_attributes()?);
 
         let mut arms: Vec<Arm> = Vec::new();
         while self.token != token::CloseDelim(token::Brace) {