Commit f7d49fd
committed
Print
Instead of using AST pretty printing.
This is a step towards removing `token::Interpolated`, which will
eventually (in rust-lang#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 rust-lang#125236.
- tests/ui/proc-macro/*: minor improvements where small differences
between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
output disappear.token::Interpolated with token stream pretty printing.1 parent a330e49 commit f7d49fd
File tree
7 files changed
+75
-246
lines changed- compiler/rustc_ast_pretty/src/pprust
- tests/ui
- macros
- proc-macro
7 files changed
+75
-246
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
885 | 878 | | |
886 | 879 | | |
887 | 880 | | |
| |||
1015 | 1008 | | |
1016 | 1009 | | |
1017 | 1010 | | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1018 | 1015 | | |
1019 | 1016 | | |
1020 | 1017 | | |
| |||
2060 | 2057 | | |
2061 | 2058 | | |
2062 | 2059 | | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | 2060 | | |
2068 | 2061 | | |
2069 | 2062 | | |
| |||
0 commit comments