diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-07-18 14:21:53 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-18 14:21:53 +0900 |
| commit | 469935f7a46e1e3f33b2c70919c70570acaeeed7 (patch) | |
| tree | 4f213fc669f54b80fed6edafc48e1363ceab5b03 /compiler/rustc_parse/src/parser | |
| parent | 76300d52f7707a1e30e4d9ff83d25dcbb01d8338 (diff) | |
| parent | 5c9bd9c2b4fdca00410209d4c33edc3bebc63444 (diff) | |
| download | rust-469935f7a46e1e3f33b2c70919c70570acaeeed7.tar.gz rust-469935f7a46e1e3f33b2c70919c70570acaeeed7.zip | |
Rollup merge of #86814 - Aaron1011:inner-doc-recover, r=estebank
Recover from a misplaced inner doc comment Fixes #86781
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/attr.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 8b050389078..e9f0038b2d6 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -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 }; |
