about summary refs log tree commit diff
path: root/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-04 06:14:13 +0200
committerGitHub <noreply@github.com>2022-10-04 06:14:13 +0200
commit185ca0f1815e5b05524670c7178b7e8cb31ebec2 (patch)
tree7624cb7dd1eadc05d975a87723d69fe650c7c416 /src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
parentf86ee786a55b10dac83f5a7c1043b81677da7683 (diff)
parent88dab8d9b3c3556e29bc551efa5ff727a15e0c6d (diff)
downloadrust-185ca0f1815e5b05524670c7178b7e8cb31ebec2.tar.gz
rust-185ca0f1815e5b05524670c7178b7e8cb31ebec2.zip
Rollup merge of #102639 - nnethercote:improve-spans-splitting, r=Aaron1011
Improve spans when splitting multi-char operator tokens for proc macros.

When a two-char (or three-char) operator token is split into single-char operator tokens before being passed to a proc macro, the single-char tokens are given the original span of length two (or three). This PR gives them more accurate spans.

r? `@Aaron1011`
cc `@petrochenkov`
Diffstat (limited to 'src/test/ui/proc-macro/debug/dump-debug-span-debug.rs')
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug-span-debug.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
index fd34eb974c0..102bd6b7b17 100644
--- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
+++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
@@ -2,6 +2,7 @@
 // aux-build:macro-dump-debug.rs
 // compile-flags: -Z span-debug
 
+
 extern crate macro_dump_debug;
 use macro_dump_debug::dump_debug;
 
@@ -9,7 +10,11 @@ dump_debug! {
     ident   // ident
     r#ident // raw ident
     ,       // alone punct
-    ==>     // joint punct
+    &&      // joint punct, two-char op
+    ||>     // joint punct, two-char op + one-char op
+    ||<<    // joint punct, two-char op + two-char op
+    ..=     // joint punct, three-char op
+    <<=!    // joint punct, three-char op + one-char-op
     ()      // empty group
     [_]     // nonempty group