Commit graph

108 commits

Author SHA1 Message Date
bors
130359cb05 Auto merge of #76010 - Aaron1011:fix/cfg-generic-param, r=petrochenkov
Run cfg-stripping on generic parameters before invoking derive macros

Fixes #75930

This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute
on a generic paramter is unusual, and combining it with a proc-macro
derive is probably even more unusual. I don't expect this to cause any
breakage.
2020-09-01 20:03:55 +00:00
Aleksey Kladov
5326361fc0 Remove trivia tokens 2020-09-01 11:39:11 +02:00
Aleksey Kladov
7d2460e5c4
Rollup merge of #76050 - matklad:pos, r=petrochenkov
Remove unused function
2020-08-31 15:22:40 +02:00
Aaron Hill
d9208665b5
Add -Z proc-macro-backtrace to allow showing proc-macro panics
Fixes #75050

Previously, we would unconditionally suppress the panic hook during
proc-macro execution. This commit adds a new flag
-Z proc-macro-backtrace, which allows running the panic hook for
easier debugging.
2020-08-30 22:17:24 -04:00
Aaron Hill
090b16717a
Factor out StmtKind::MacCall fields into MacCallStmt struct
In PR #76130, I add a fourth field, which makes using a tuple variant
somewhat unwieldy.
2020-08-30 18:38:53 -04:00
Aleksey Kladov
ccffea5b6b Move lexer unit tests to rustc_lexer
StringReader is an intornal abstraction which at the moment changes a
lot, so these unit tests cause quite a bit of friction.

Moving them to rustc_lexer and more ingerated-testing style should
make them much less annoying, hopefully without decreasing their
usefulness much.

Note that coloncolon tests are removed (it's unclear what those are
testing).

\r\n tests are removed as well, as we normalize line endings even
before lexing.
2020-08-30 19:53:36 +02:00
Aaron Hill
a97dcfa375
Run cfg-stripping on generic parameters before invoking derive macros
Fixes #75930

This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute
on a generic paramter is unusual, and combining it with a proc-macro
derive is probably even more unusual. I don't expect this to cause any
breakage.
2020-08-30 13:46:19 -04:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00