Rollup merge of #86814 - Aaron1011:inner-doc-recover, r=estebank
Recover from a misplaced inner doc comment Fixes #86781
This commit is contained in:
commit
469935f7a4
3 changed files with 30 additions and 1 deletions
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue