about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/lexer
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-08-08 11:34:07 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-12 08:46:15 +1100
commitbecf4942a26288916302f9a5f3fc6d4cc88abae8 (patch)
treec7f35dd6a997c26ef0b95c74c8d8d1d1fd69978d /compiler/rustc_parse/src/lexer
parent475c71da0710fd1d40c046f9cee04b733b5b2b51 (diff)
downloadrust-becf4942a26288916302f9a5f3fc6d4cc88abae8.tar.gz
rust-becf4942a26288916302f9a5f3fc6d4cc88abae8.zip
Rename `Token::is_op` as `Token::is_punct`.
For consistency with `proc_macro::Punct`.
Diffstat (limited to 'compiler/rustc_parse/src/lexer')
-rw-r--r--compiler/rustc_parse/src/lexer/tokentrees.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/lexer/tokentrees.rs b/compiler/rustc_parse/src/lexer/tokentrees.rs
index 07910113dee..7cdb1970470 100644
--- a/compiler/rustc_parse/src/lexer/tokentrees.rs
+++ b/compiler/rustc_parse/src/lexer/tokentrees.rs
@@ -59,8 +59,11 @@ impl<'a> TokenTreesReader<'a> {
                             if let Some(glued) = self.token.glue(&next_tok) {
                                 self.token = glued;
                             } else {
-                                let this_spacing =
-                                    if next_tok.is_op() { Spacing::Joint } else { Spacing::Alone };
+                                let this_spacing = if next_tok.is_punct() {
+                                    Spacing::Joint
+                                } else {
+                                    Spacing::Alone
+                                };
                                 break (this_spacing, next_tok);
                             }
                         } else {