diff options
| author | bors <bors@rust-lang.org> | 2024-08-15 20:04:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-15 20:04:49 +0000 |
| commit | 2c93fabd98d2c183bcb3afed1f7d51b2517ac5ed (patch) | |
| tree | 13c751c5f4e50f36688d181702032d81dcb7b9fe /compiler/rustc_parse/src/parser/mod.rs | |
| parent | d2b5aa6552c8acf67f38a2ad92062a32ec542f08 (diff) | |
| parent | ef72a6a7111731049e840c129fc3db4838df5352 (diff) | |
| download | rust-2c93fabd98d2c183bcb3afed1f7d51b2517ac5ed.tar.gz rust-2c93fabd98d2c183bcb3afed1f7d51b2517ac5ed.zip | |
Auto merge of #129130 - matthiaskrgr:rollup-603jta0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #128348 (Unconditionally allow shadow call-stack sanitizer for AArch64) - #129065 (Use `impl PartialEq<TokenKind> for Token` more.) - #129072 (Infer async closure args from `Fn` bound even if there is no corresponding `Future` bound on return) - #129096 (Print more verbose error for commands that capture output) - #129101 (Fix projections when parent capture is by-ref but child capture is by-value in the `ByMoveBody` pass) - #129106 (Remove redundant type ops: `Eq`/`Subtype`) - #129122 (Remove duplicated `Rustdoc::output` method from `run-make-support` lib) - #129124 (rustdoc-json: Use FxHashMap from rustdoc_json_types) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 9b3b6d5f9ad..db74ea62790 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -527,7 +527,7 @@ impl<'a> Parser<'a> { } else if inedible.contains(&self.token.kind) { // leave it in the input Ok(Recovered::No) - } else if self.token.kind != token::Eof + } else if self.token != token::Eof && self.last_unexpected_token_span == Some(self.token.span) { FatalError.raise(); @@ -756,7 +756,7 @@ impl<'a> Parser<'a> { /// compound tokens like multi-character operators in process. /// Returns `true` if the token was eaten. fn break_and_eat(&mut self, expected: TokenKind) -> bool { - if self.token.kind == expected { + if self.token == expected { self.bump(); return true; } @@ -882,7 +882,7 @@ impl<'a> Parser<'a> { let token_str = pprust::token_kind_to_string(t); match self.current_closure.take() { - Some(closure_spans) if self.token.kind == TokenKind::Semi => { + Some(closure_spans) if self.token == TokenKind::Semi => { // Finding a semicolon instead of a comma // after a closure body indicates that the // closure body may be a block but the user @@ -910,7 +910,7 @@ impl<'a> Parser<'a> { // If this was a missing `@` in a binding pattern // bail with a suggestion // https://github.com/rust-lang/rust/issues/72373 - if self.prev_token.is_ident() && self.token.kind == token::DotDot { + if self.prev_token.is_ident() && self.token == token::DotDot { let msg = format!( "if you meant to bind the contents of the rest of the array \ pattern into `{}`, use `@`", |
