about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-18 08:15:17 +0000
committerbors <bors@rust-lang.org>2021-07-18 08:15:17 +0000
commit5a8a44196b3cf099f8c9b0156bd902eaec0b4e5f (patch)
tree44c6de9143298d107532d67ee58eff441f6ded1d /compiler/rustc_parse/src
parent3ab6b60337edeb49339d173853fee1f8569421e0 (diff)
parent810e47897aae7d19c7f0a58dc8ede07a4caae2a0 (diff)
downloadrust-5a8a44196b3cf099f8c9b0156bd902eaec0b4e5f.tar.gz
rust-5a8a44196b3cf099f8c9b0156bd902eaec0b4e5f.zip
Auto merge of #87242 - JohnTitor:rollup-t9rmwpo, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #86763 (Add a regression test for issue-63355)
 - #86814 (Recover from a misplaced inner doc comment)
 - #86843 (Check that const parameters of trait methods have compatible types)
 - #86889 (rustdoc: Cleanup ExternalCrate)
 - #87092 (Remove nondeterminism in multiple-definitions test)
 - #87170 (Add diagnostic items for Clippy)
 - #87183 (fix typo in compile_fail doctest)
 - #87205 (rustc_middle: remove redundant clone)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/attr.rs9
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
             };