diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-09 17:44:47 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-14 16:37:09 +1000 |
| commit | 7923b20dd9587743372b3fdf7b48eae220200f6e (patch) | |
| tree | 9c6649ffab5d4b4b19337f75c925fda3d90a4671 /compiler/rustc_parse/src/parser/generics.rs | |
| parent | bbcfd90cd17a5d8a812cf3dcf9e5197b72ddde4b (diff) | |
| download | rust-7923b20dd9587743372b3fdf7b48eae220200f6e.tar.gz rust-7923b20dd9587743372b3fdf7b48eae220200f6e.zip | |
Use `impl PartialEq<TokenKind> for Token` more.
This lets us compare a `Token` with a `TokenKind`. It's used a lot, but can be used even more, avoiding the need for some `.kind` uses.
Diffstat (limited to 'compiler/rustc_parse/src/parser/generics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/generics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 9124c15707d..f1bb7187e2f 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -393,7 +393,7 @@ impl<'a> Parser<'a> { if let Some(struct_) = struct_ && self.may_recover() - && self.token.kind == token::OpenDelim(Delimiter::Parenthesis) + && self.token == token::OpenDelim(Delimiter::Parenthesis) { snapshot = Some((struct_, self.create_snapshot_for_diagnostic())); }; |
