Skip to content

Remove normalization of Span debug output in proc-macro tests #75345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/test/ui/proc-macro/doc-comment-preserved.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// check-pass
// compile-flags: -Z span-debug
// aux-build:test-macros.rs

// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;

#[macro_use]
extern crate test_macros;
Expand Down
18 changes: 9 additions & 9 deletions src/test/ui/proc-macro/doc-comment-preserved.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Alone,
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "doc",
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0),
},
Punct {
ch: '=',
spacing: Alone,
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0),
},
Literal {
kind: Str,
symbol: "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n",
suffix: None,
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0),
},
],
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0),
},
Ident {
ident: "pub",
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:20:1: 20:4 (#0),
},
Ident {
ident: "struct",
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:20:5: 20:11 (#0),
},
Ident {
ident: "S",
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:20:12: 20:13 (#0),
},
Punct {
ch: ';',
spacing: Alone,
span: #0 bytes(LO..HI),
span: $DIR/doc-comment-preserved.rs:20:13: 20:14 (#0),
},
]
7 changes: 3 additions & 4 deletions src/test/ui/proc-macro/dollar-crate-issue-57089.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// check-pass
// edition:2018
// compile-flags: -Z span-debug
// aux-build:test-macros.rs

// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
// normalize-stdout-test "#\d+" -> "#CTXT"
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;

#[macro_use]
extern crate test_macros;
Expand Down
32 changes: 16 additions & 16 deletions src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,79 @@ PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ;
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:13: 17:19 (#3),
},
Ident {
ident: "M",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:20: 17:21 (#3),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:22: 17:28 (#3),
},
Punct {
ch: ':',
spacing: Joint,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#3),
},
Punct {
ch: ':',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#3),
},
Ident {
ident: "S",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:30: 17:31 (#3),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:21: 17:32 (#3),
},
Punct {
ch: ';',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:17:32: 17:33 (#3),
},
]
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:9: 21:15 (#3),
},
Ident {
ident: "A",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:16: 21:17 (#3),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:18: 21:24 (#3),
},
Punct {
ch: ':',
spacing: Joint,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#3),
},
Punct {
ch: ':',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#3),
},
Ident {
ident: "S",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:26: 21:27 (#3),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:17: 21:28 (#3),
},
Punct {
ch: ';',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-57089.rs:21:28: 21:29 (#3),
},
]
8 changes: 4 additions & 4 deletions src/test/ui/proc-macro/dollar-crate-issue-62325.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// check-pass
// edition:2018
// compile-flags: -Z span-debug
// aux-build:test-macros.rs
// aux-build:dollar-crate-external.rs

// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
// normalize-stdout-test "#\d+" -> "#CTXT"

#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;

#[macro_use]
extern crate test_macros;
Expand Down
44 changes: 22 additions & 22 deletions src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,109 @@ PRINT-ATTR INPUT (DISPLAY): struct A(identity ! ($crate :: S)) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:5: 19:11 (#3),
},
Ident {
ident: "A",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:12: 19:13 (#3),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "identity",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:14: 19:22 (#3),
},
Punct {
ch: '!',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:22: 19:23 (#3),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:24: 19:30 (#3),
},
Punct {
ch: ':',
spacing: Joint,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#3),
},
Punct {
ch: ':',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#3),
},
Ident {
ident: "S",
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:32: 19:33 (#3),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:23: 19:34 (#3),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:13: 19:35 (#3),
},
Punct {
ch: ';',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/dollar-crate-issue-62325.rs:19:35: 19:36 (#3),
},
]
PRINT-ATTR INPUT (DISPLAY): struct B(identity ! ($crate :: S)) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:5: 21:11 (#10),
},
Ident {
ident: "B",
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:12: 21:13 (#10),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "identity",
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:14: 21:22 (#10),
},
Punct {
ch: '!',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:22: 21:23 (#10),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:24: 21:30 (#10),
},
Punct {
ch: ':',
spacing: Joint,
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#10),
},
Punct {
ch: ':',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#10),
},
Ident {
ident: "S",
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:32: 21:33 (#10),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:23: 21:34 (#10),
},
],
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:13: 21:35 (#10),
},
Punct {
ch: ';',
spacing: Alone,
span: #CTXT bytes(LO..HI),
span: $DIR/auxiliary/dollar-crate-external.rs:21:35: 21:36 (#10),
},
]
7 changes: 3 additions & 4 deletions src/test/ui/proc-macro/dollar-crate.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// check-pass
// edition:2018
// compile-flags: -Z span-debug
// aux-build:test-macros.rs
// aux-build:dollar-crate-external.rs

// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
// normalize-stdout-test "#\d+" -> "#CTXT"
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;

#[macro_use]
extern crate test_macros;
Expand Down
Loading