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_expand/src | |
| 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_expand/src')
| -rw-r--r-- | compiler/rustc_expand/src/mbe/macro_rules.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 6f177107e70..256713ef730 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -1154,7 +1154,7 @@ fn check_matcher_core<'tt>( && matches!(kind, NonterminalKind::Pat(PatParam { inferred: true })) && matches!( next_token, - TokenTree::Token(token) if token.kind == BinOp(token::BinOpToken::Or) + TokenTree::Token(token) if *token == BinOp(token::BinOpToken::Or) ) { // It is suggestion to use pat_param, for example: $x:pat -> $x:pat_param. |
