diff options
| author | bors <bors@rust-lang.org> | 2024-07-11 22:56:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-11 22:56:52 +0000 |
| commit | 5e311f933d844b6922256a0c0aa49b86159534f5 (patch) | |
| tree | b9624b52ca26a432be873fd65decdf104c594bc4 /compiler/rustc_parse/src/parser | |
| parent | 5315cbe15b79533f380bbb6685aa5480d5ff4ef5 (diff) | |
| parent | fa3ce50f0bdd7c7bed08e9f6d2ef2b21368aed4f (diff) | |
| download | rust-5e311f933d844b6922256a0c0aa49b86159534f5.tar.gz rust-5e311f933d844b6922256a0c0aa49b86159534f5.zip | |
Auto merge of #127614 - matthiaskrgr:rollup-8geziwi, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #124599 (Suggest borrowing on fn argument that is `impl AsRef`) - #127572 (Don't mark `DEBUG_EVENT` struct as `repr(packed)`) - #127588 (core: Limit remaining f16 doctests to x86_64 linux) - #127591 (Make sure that labels are defined after the primary span in diagnostics) - #127598 (Allows `#[diagnostic::do_not_recommend]` to supress trait impls in suggestions as well) - #127599 (Rename `lazy_cell_consume` to `lazy_cell_into_inner`) - #127601 (check is_ident before parse_ident) - #127605 (Remove extern "wasm" ABI) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index f31e634f55c..2c98feeece7 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -387,8 +387,8 @@ impl<'a> Parser<'a> { let span = if is_pub { self.prev_token.span.to(ident_span) } else { ident_span }; let insert_span = ident_span.shrink_to_lo(); - let ident = if (!is_const - || self.look_ahead(1, |t| *t == token::OpenDelim(Delimiter::Parenthesis))) + let ident = if self.token.is_ident() + && (!is_const || self.look_ahead(1, |t| *t == token::OpenDelim(Delimiter::Parenthesis))) && self.look_ahead(1, |t| { [ token::Lt, |
