]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_parse/src/parser/attr.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / compiler / rustc_parse / src / parser / attr.rs
index 8b050389078a648311b408e4415fd19a42541707..e9f0038b2d65dc9d09b763c3ae596d4fb8212e6d 100644 (file)
@@ -64,7 +64,14 @@ impl<'a> Parser<'a> {
                 }
                 self.bump();
                 just_parsed_doc_comment = true;
-                Some(attr::mk_doc_comment(comment_kind, attr_style, data, self.prev_token.span))
+                // Always make an outer attribute - this allows us to recover from a misplaced
+                // inner attribute.
+                Some(attr::mk_doc_comment(
+                    comment_kind,
+                    ast::AttrStyle::Outer,
+                    data,
+                    self.prev_token.span,
+                ))
             } else {
                 None
             };