rust/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout
Nicholas Nethercote f7d49fdf4f Print token::Interpolated with token stream pretty printing.
Instead of using AST pretty printing.

This is a step towards removing `token::Interpolated`, which will
eventually (in #124141) be replaced with a token stream within invisible
delimiters.

This changes (improves) the output of the `stringify!` macro in some
cases. This is allowed. As the `stringify!` docs say: "Note that the
expanded results of the input tokens may change in the future. You
should be careful if you rely on the output."

Test changes:

- tests/ui/macros/stringify.rs: this used to test both token stream
  pretty printing and AST pretty printing via different ways of invoking
  of `stringify!` (i.e. `$expr` vs `$tt`). But those two different
  invocations now give the same result, which is a nice consistency
  improvement. This removes the need for all the `c2*` macros. The AST
  pretty printer now has more thorough testing thanks to #125236.

- tests/ui/proc-macro/*: minor improvements where small differences
  between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
  output disappear.
2024-06-05 13:07:32 +10:00

86 lines
3.6 KiB
Plaintext

PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar { #![doc = r" Foo"] } }
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "foo",
span: $DIR/issue-78675-captured-inner-attrs.rs:20:9: 20:12 (#3),
},
Punct {
ch: '!',
spacing: Alone,
span: $DIR/issue-78675-captured-inner-attrs.rs:20:12: 20:13 (#3),
},
Group {
delimiter: Brace,
stream: TokenStream [
Punct {
ch: '#',
spacing: Alone,
span: $DIR/issue-78675-captured-inner-attrs.rs:21:13: 21:14 (#3),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "fake_attr",
span: $DIR/issue-78675-captured-inner-attrs.rs:21:15: 21:24 (#3),
},
],
span: $DIR/issue-78675-captured-inner-attrs.rs:21:14: 21:25 (#3),
},
Group {
delimiter: None,
stream: TokenStream [
Ident {
ident: "mod",
span: $DIR/issue-78675-captured-inner-attrs.rs:27:5: 27:8 (#0),
},
Ident {
ident: "bar",
span: $DIR/issue-78675-captured-inner-attrs.rs:27:9: 27:12 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Punct {
ch: '#',
spacing: Joint,
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
Punct {
ch: '!',
spacing: Alone,
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "doc",
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
Punct {
ch: '=',
spacing: Alone,
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
Literal {
kind: StrRaw(0),
symbol: " Foo",
suffix: None,
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
],
span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0),
},
],
span: $DIR/issue-78675-captured-inner-attrs.rs:27:13: 29:6 (#0),
},
],
span: $DIR/issue-78675-captured-inner-attrs.rs:22:13: 22:18 (#3),
},
],
span: $DIR/issue-78675-captured-inner-attrs.rs:20:14: 23:10 (#3),
},
]