rust/src/test/ui/rfc-2565-param-attrs
Manish Goregaokar 8ed5c0d37a
Rollup merge of #73345 - petrochenkov:nointerp, r=Aaron1011
expand: Stop using nonterminals for passing tokens to attribute and derive macros

Make one more step towards fully token-based expansion and fix issues described in https://github.com/rust-lang/rust/issues/72545#issuecomment-640276791.

Now `struct S;` is passed to `foo!(struct S;)` and `#[foo] struct S;` in the same way - as a token stream `struct S ;`, rather than a single non-terminal token `NtItem` which is then broken into parts later.

The cost is making pretty-printing of token streams less pretty.
Some of the pretty-printing regressions will be recovered by keeping jointness with each token, which we will need to do anyway.

Unfortunately, this is not exactly the same thing as https://github.com/rust-lang/rust/pull/73102.
One more observable effect is how `$crate` is printed in the attribute input.
Inside `NtItem` was printed as `crate` or `that_crate`, now as a part of a token stream it's printed as `$crate` (there are good reasons for these differences, see https://github.com/rust-lang/rust/pull/62393 and related PRs).
This may break old proc macros (custom derives) written before the main portion of the proc macro API (macros 1.2) was stabilized, those macros did `input.to_string()` and reparsed the result, now that result can contain `$crate` which cannot be reparsed.

So, I think we should do this regardless, but we need to run crater first.
r? @Aaron1011
2020-07-01 20:35:44 -07:00
..
auxiliary expand: Stop using nonterminals for passing tokens to attribute and derive macros 2020-07-01 13:13:21 +03:00
attr-without-param.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
attr-without-param.stderr syntax: fix #64682. 2019-09-29 12:55:45 +02:00
issue-64682-dropping-first-attrs-in-impl-fns.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
param-attrs-2018.rs Stabilize param_attrs in Rust 1.39.0 2019-09-11 10:13:43 -03:00
param-attrs-2018.stderr Fix wording for anonymous parameter name help 2020-06-27 22:55:42 -05:00
param-attrs-allowed.rs Stabilize param_attrs in Rust 1.39.0 2019-09-11 10:13:43 -03:00
param-attrs-builtin-attrs.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
param-attrs-builtin-attrs.stderr syntax: fix #64682. 2019-09-29 12:55:45 +02:00
param-attrs-cfg.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
param-attrs-cfg.stderr Reword unused variable warning 2020-03-23 12:14:45 +03:00
param-attrs-pretty.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
proc-macro-cannot-be-used.rs syntax: fix #64682. 2019-09-29 12:55:45 +02:00
proc-macro-cannot-be-used.stderr syntax: fix #64682. 2019-09-29 12:55:45 +02:00