about summary refs log tree commit diff
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
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`
-rw-r--r--compiler/rustc_expand/src/proc_macro_server.rs16
-rw-r--r--src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr2
-rw-r--r--src/test/ui/proc-macro/attr-complex-fn.stdout4
-rw-r--r--src/test/ui/proc-macro/capture-macro-rules-invoke.stdout12
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug-span-debug.rs7
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr127
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug.stderr6
-rw-r--r--src/test/ui/proc-macro/dollar-crate-issue-57089.stdout8
-rw-r--r--src/test/ui/proc-macro/dollar-crate-issue-62325.stdout8
-rw-r--r--src/test/ui/proc-macro/dollar-crate.stdout24
-rw-r--r--src/test/ui/proc-macro/inner-attrs.stdout4
-rw-r--r--src/test/ui/proc-macro/issue-75930-derive-cfg.stdout20
-rw-r--r--src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout4
-rw-r--r--src/test/ui/proc-macro/meta-macro-hygiene.stdout2
-rw-r--r--src/test/ui/proc-macro/three-equals.stderr6
15 files changed, 166 insertions, 84 deletions
diff --git a/compiler/rustc_expand/src/proc_macro_server.rs b/compiler/rustc_expand/src/proc_macro_server.rs
index ff09a9fb87a..17a348ec6ba 100644
--- a/compiler/rustc_expand/src/proc_macro_server.rs
+++ b/compiler/rustc_expand/src/proc_macro_server.rs
@@ -115,8 +115,20 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre
             // before that get `joint = true`.
             let mut op = |s: &str| {
                 assert!(s.is_ascii());
-                trees.extend(s.bytes().enumerate().map(|(idx, ch)| {
-                    let is_final = idx == s.len() - 1;
+                trees.extend(s.bytes().enumerate().map(|(i, ch)| {
+                    let is_final = i == s.len() - 1;
+                    // Split the token span into single chars. Unless the span
+                    // is an unusual one, e.g. due to proc macro expansion. We
+                    // determine this by assuming any span with a length that
+                    // matches the operator length is a normal one, and any
+                    // span with a different length is an unusual one.
+                    let span = if (span.hi() - span.lo()).to_usize() == s.len() {
+                        let lo = span.lo() + BytePos::from_usize(i);
+                        let hi = lo + BytePos::from_usize(1);
+                        span.with_lo(lo).with_hi(hi)
+                    } else {
+                        span
+                    };
                     TokenTree::Punct(Punct { ch, joint: if is_final { joint } else { true }, span })
                 }));
             };
diff --git a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
index bc0c5330324..e31d14c5596 100644
--- a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
+++ b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
@@ -1,4 +1,4 @@
-TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..489) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(487..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..506) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(504..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
+TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..488) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(488..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..505) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(505..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
 error: unnecessary trailing semicolon
   --> $DIR/redundant-semi-proc-macro.rs:9:19
    |
diff --git a/src/test/ui/proc-macro/attr-complex-fn.stdout b/src/test/ui/proc-macro/attr-complex-fn.stdout
index fc69a13ddb9..b12eb587fc7 100644
--- a/src/test/ui/proc-macro/attr-complex-fn.stdout
+++ b/src/test/ui/proc-macro/attr-complex-fn.stdout
@@ -53,12 +53,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
     Punct {
         ch: '>',
         spacing: Joint,
-        span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
+        span: $DIR/attr-complex-fn.rs:19:36: 19:37 (#0),
     },
     Punct {
         ch: '>',
         spacing: Joint,
-        span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
+        span: $DIR/attr-complex-fn.rs:19:37: 19:38 (#0),
     },
     Punct {
         ch: '>',
diff --git a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
index 4de8746a1b4..b88fbd3e897 100644
--- a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
+++ b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
@@ -177,12 +177,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
+                span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:17 (#0),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
+                span: $DIR/capture-macro-rules-invoke.rs:45:17: 45:18 (#0),
             },
             Ident {
                 ident: "option",
@@ -191,12 +191,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
+                span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:25 (#0),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
+                span: $DIR/capture-macro-rules-invoke.rs:45:25: 45:26 (#0),
             },
             Ident {
                 ident: "Option",
@@ -231,12 +231,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: ':',
                         spacing: Joint,
-                        span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
+                        span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:25 (#0),
                     },
                     Punct {
                         ch: ':',
                         spacing: Alone,
-                        span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
+                        span: $DIR/capture-macro-rules-invoke.rs:46:25: 46:26 (#0),
                     },
                     Ident {
                         ident: "path",
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
 
diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
index 2c05bdbc492..fa65cbbf1ea 100644
--- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
+++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
@@ -1,166 +1,231 @@
-TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }]
+TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0) }, Punct { ch: '&', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0) }, Punct { ch: '&', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0) }, Punct { ch: '<', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0) }, Punct { ch: '=', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0) }, Punct { ch: '!', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0) }]
 TokenStream [
     Ident {
         ident: "ident",
-        span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0),
+        span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0),
     },
     Ident {
         ident: "r#ident",
-        span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0),
+        span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0),
     },
     Punct {
         ch: ',',
         spacing: Alone,
-        span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0),
+        span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0),
+    },
+    Punct {
+        ch: '&',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0),
+    },
+    Punct {
+        ch: '&',
+        spacing: Alone,
+        span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0),
+    },
+    Punct {
+        ch: '|',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0),
+    },
+    Punct {
+        ch: '|',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
+    },
+    Punct {
+        ch: '>',
+        spacing: Alone,
+        span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0),
+    },
+    Punct {
+        ch: '|',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0),
+    },
+    Punct {
+        ch: '|',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0),
+    },
+    Punct {
+        ch: '<',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0),
+    },
+    Punct {
+        ch: '<',
+        spacing: Alone,
+        span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0),
+    },
+    Punct {
+        ch: '.',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0),
+    },
+    Punct {
+        ch: '.',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0),
     },
     Punct {
         ch: '=',
+        spacing: Alone,
+        span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0),
+    },
+    Punct {
+        ch: '<',
         spacing: Joint,
-        span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
+        span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
+    },
+    Punct {
+        ch: '<',
+        spacing: Joint,
+        span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0),
     },
     Punct {
         ch: '=',
         spacing: Joint,
-        span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
+        span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0),
     },
     Punct {
-        ch: '>',
+        ch: '!',
         spacing: Alone,
-        span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0),
+        span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0),
+        span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0),
     },
     Group {
         delimiter: Bracket,
         stream: TokenStream [
             Ident {
                 ident: "_",
-                span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
+                span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0),
             },
         ],
-        span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0),
+        span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
     },
     Literal {
         kind: Integer,
         symbol: "0",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
+        span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0),
     },
     Literal {
         kind: Float,
         symbol: "1.0",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0),
+        span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0),
     },
     Literal {
         kind: Str,
         symbol: "S",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
+        span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0),
     },
     Literal {
         kind: ByteStr,
         symbol: "B",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0),
     },
     Literal {
         kind: StrRaw(0),
         symbol: "R",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
     },
     Literal {
         kind: StrRaw(2),
         symbol: "R",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0),
+        span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0),
     },
     Literal {
         kind: ByteStrRaw(0),
         symbol: "BR",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0),
+        span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0),
     },
     Literal {
         kind: ByteStrRaw(2),
         symbol: "BR",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0),
+        span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0),
     },
     Literal {
         kind: Char,
         symbol: "C",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0),
+        span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0),
     },
     Literal {
         kind: Byte,
         symbol: "B",
         suffix: None,
-        span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
     },
     Literal {
         kind: Integer,
         symbol: "0",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0),
+        span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0),
     },
     Literal {
         kind: Float,
         symbol: "1.0",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0),
     },
     Literal {
         kind: Str,
         symbol: "S",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0),
     },
     Literal {
         kind: ByteStr,
         symbol: "B",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0),
+        span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0),
     },
     Literal {
         kind: StrRaw(0),
         symbol: "R",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0),
+        span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
     },
     Literal {
         kind: StrRaw(2),
         symbol: "R",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0),
+        span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0),
     },
     Literal {
         kind: ByteStrRaw(0),
         symbol: "BR",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0),
+        span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0),
     },
     Literal {
         kind: ByteStrRaw(2),
         symbol: "BR",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0),
+        span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0),
     },
     Literal {
         kind: Char,
         symbol: "C",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0),
+        span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0),
     },
     Literal {
         kind: Byte,
         symbol: "B",
         suffix: Some("q"),
-        span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
+        span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0),
     },
 ]
diff --git a/src/test/ui/proc-macro/debug/dump-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug.stderr
index 0aedefd4e60..db422b6012a 100644
--- a/src/test/ui/proc-macro/debug/dump-debug.stderr
+++ b/src/test/ui/proc-macro/debug/dump-debug.stderr
@@ -1,4 +1,4 @@
-TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
+TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..204) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(204..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
 TokenStream [
     Ident {
         ident: "ident",
@@ -16,12 +16,12 @@ TokenStream [
     Punct {
         ch: '=',
         spacing: Joint,
-        span: #0 bytes(203..205),
+        span: #0 bytes(203..204),
     },
     Punct {
         ch: '=',
         spacing: Joint,
-        span: #0 bytes(203..205),
+        span: #0 bytes(204..205),
     },
     Punct {
         ch: '>',
diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
index c0c9ed72c5a..2622c005d93 100644
--- a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
+++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
+                span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#4),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
+                span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#4),
             },
             Ident {
                 ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
+                span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#4),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
+                span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#4),
             },
             Ident {
                 ident: "S",
diff --git a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
index e6148a687fd..a91908239c3 100644
--- a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
+++ b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
@@ -30,12 +30,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: ':',
                         spacing: Joint,
-                        span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
+                        span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#4),
                     },
                     Punct {
                         ch: ':',
                         spacing: Alone,
-                        span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
+                        span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#4),
                     },
                     Ident {
                         ident: "S",
@@ -85,12 +85,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: ':',
                         spacing: Joint,
-                        span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
+                        span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#12),
                     },
                     Punct {
                         ch: ':',
                         spacing: Alone,
-                        span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
+                        span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#12),
                     },
                     Ident {
                         ident: "S",
diff --git a/src/test/ui/proc-macro/dollar-crate.stdout b/src/test/ui/proc-macro/dollar-crate.stdout
index d01fcb9d0e4..4e169d47e1a 100644
--- a/src/test/ui/proc-macro/dollar-crate.stdout
+++ b/src/test/ui/proc-macro/dollar-crate.stdout
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
+                span: $DIR/dollar-crate.rs:20:32: 20:33 (#4),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
+                span: $DIR/dollar-crate.rs:20:33: 20:34 (#4),
             },
             Ident {
                 ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
+                span: $DIR/dollar-crate.rs:24:28: 24:29 (#4),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
+                span: $DIR/dollar-crate.rs:24:29: 24:30 (#4),
             },
             Ident {
                 ident: "S",
@@ -98,12 +98,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
+                span: $DIR/dollar-crate.rs:27:28: 27:29 (#4),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
+                span: $DIR/dollar-crate.rs:27:29: 27:30 (#4),
             },
             Ident {
                 ident: "S",
@@ -138,12 +138,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#15),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#15),
             },
             Ident {
                 ident: "S",
@@ -178,12 +178,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#15),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#15),
             },
             Ident {
                 ident: "S",
@@ -218,12 +218,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
             Punct {
                 ch: ':',
                 spacing: Joint,
-                span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#15),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
+                span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#15),
             },
             Ident {
                 ident: "S",
diff --git a/src/test/ui/proc-macro/inner-attrs.stdout b/src/test/ui/proc-macro/inner-attrs.stdout
index 490fc02f510..ee8adf0b4a9 100644
--- a/src/test/ui/proc-macro/inner-attrs.stdout
+++ b/src/test/ui/proc-macro/inner-attrs.stdout
@@ -627,12 +627,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/inner-attrs.rs:39:15: 39:17 (#0),
+                                        span: $DIR/inner-attrs.rs:39:15: 39:16 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/inner-attrs.rs:39:15: 39:17 (#0),
+                                        span: $DIR/inner-attrs.rs:39:16: 39:17 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
index c81fa201cbc..83afd0d3eae 100644
--- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
+++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
@@ -489,12 +489,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:33 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:33:33: 33:34 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
@@ -567,12 +567,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
@@ -591,12 +591,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
@@ -1519,12 +1519,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
@@ -1543,12 +1543,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+                                        span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
diff --git a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
index 5493f9c7b60..09eb33f7e31 100644
--- a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
+++ b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
@@ -41,12 +41,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: '=',
                         spacing: Joint,
-                        span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
+                        span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:22 (#0),
                     },
                     Punct {
                         ch: '>',
                         spacing: Alone,
-                        span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
+                        span: $DIR/issue-76182-leading-vert-pat.rs:15:22: 15:23 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.stdout b/src/test/ui/proc-macro/meta-macro-hygiene.stdout
index 5d04fe1e3de..2494af1208f 100644
--- a/src/test/ui/proc-macro/meta-macro-hygiene.stdout
+++ b/src/test/ui/proc-macro/meta-macro-hygiene.stdout
@@ -1,5 +1,5 @@
 Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5)
-Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
+Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
 Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }]
 #![feature /* 0#0 */(prelude_import)]
 // aux-build:make-macro.rs
diff --git a/src/test/ui/proc-macro/three-equals.stderr b/src/test/ui/proc-macro/three-equals.stderr
index 1ce5e02bd82..9cdb2a21b04 100644
--- a/src/test/ui/proc-macro/three-equals.stderr
+++ b/src/test/ui/proc-macro/three-equals.stderr
@@ -8,16 +8,16 @@ LL |     three_equals!(==);
    = note: this error originates in the macro `three_equals` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected EOF, found `=`.
-  --> $DIR/three-equals.rs:15:21
+  --> $DIR/three-equals.rs:15:22
    |
 LL |     three_equals!(=====);
-   |                     ^^
+   |                      ^
    |
 note: last good input was here
   --> $DIR/three-equals.rs:15:21
    |
 LL |     three_equals!(=====);
-   |                     ^^
+   |                     ^
    = help: input must be: `===`
 
 error: expected `=`, found `abc`.