about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-23 05:22:05 +0000
committerbors <bors@rust-lang.org>2022-08-23 05:22:05 +0000
commit38528d4dc0a0c079069764f23f11ef9f4fba2f95 (patch)
treee586ec664aa338e03b1dcdccf1e276e690697d82 /compiler/rustc_parse/src
parent7e3e8a816f91fda5c6e05c659d7038747aff0b55 (diff)
parent683a08af6a510c12c5df596de53046ba5afd2cfd (diff)
downloadrust-38528d4dc0a0c079069764f23f11ef9f4fba2f95.tar.gz
rust-38528d4dc0a0c079069764f23f11ef9f4fba2f95.zip
Auto merge of #100904 - matthiaskrgr:rollup-z3yzivj, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #100382 (Make the GATS self outlives error take into GATs in the inputs)
 - #100565 (Suggest adding a missing semicolon before an item)
 - #100641 (Add the armv4t-none-eabi target to the supported_targets)
 - #100789 (Use separate infcx to solve obligations during negative coherence)
 - #100832 (Some small bootstrap cleanup)
 - #100861 (fix ICE with extra-const-ub-checks)
 - #100862 (tidy: remove crossbeam-utils)
 - #100887 (Refactor part of codegen_call_terminator)
 - #100893 (Remove out-of-context comment in `mem::MaybeUninit` documentation)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 2c9f9a2c2c2..b8884dd32d6 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -927,10 +927,12 @@ impl<'a> Parser<'a> {
                 return Ok(true);
             } else if self.look_ahead(0, |t| {
                 t == &token::CloseDelim(Delimiter::Brace)
-                    || (t.can_begin_expr() && t != &token::Semi && t != &token::Pound)
+                    || ((t.can_begin_expr() || t.can_begin_item())
+                        && t != &token::Semi
+                        && t != &token::Pound)
                     // Avoid triggering with too many trailing `#` in raw string.
                     || (sm.is_multiline(
-                        self.prev_token.span.shrink_to_hi().until(self.token.span.shrink_to_lo())
+                        self.prev_token.span.shrink_to_hi().until(self.token.span.shrink_to_lo()),
                     ) && t == &token::Pound)
             }) && !expected.contains(&TokenType::Token(token::Comma))
             {