about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-23 23:48:55 +0000
committerbors <bors@rust-lang.org>2021-11-23 23:48:55 +0000
commitde4b242e1e2143f549f25ac5a8f7de9d902ef3b4 (patch)
tree011f18a57df9b2b571789a02744627597c7939ce /compiler/rustc_parse/src/parser
parent65c55bf931a55e6b1e5ed14ad8623814a7386424 (diff)
parent1e21dfa33a5ff3bc369844f6f50e53b63358e340 (diff)
downloadrust-de4b242e1e2143f549f25ac5a8f7de9d902ef3b4.tar.gz
rust-de4b242e1e2143f549f25ac5a8f7de9d902ef3b4.zip
Auto merge of #91149 - notriddle:notriddle/rustdoc-doctest-semicolon, r=jyn514
fix(doctest): detect extern crate items in statement doctests

This partially reverts #91026, because rustdoc needs to detect the extern statements, even when they appear inside implicit `main()`. It does not entirely revert it, so the old bug is still fixed, by duplicating some of the logic from `parse_mod` instead of trying to use it directly.

Fixes #91134
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 81328e09156..17e79a02360 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -1121,7 +1121,7 @@ impl<'a> Parser<'a> {
         Ok(P(T::recovered(Some(QSelf { ty, path_span, position: 0 }), path)))
     }
 
-    pub(super) fn maybe_consume_incorrect_semicolon(&mut self, items: &[P<Item>]) -> bool {
+    pub fn maybe_consume_incorrect_semicolon(&mut self, items: &[P<Item>]) -> bool {
         if self.eat(&token::Semi) {
             let mut err = self.struct_span_err(self.prev_token.span, "expected item, found `;`");
             err.span_suggestion_short(