about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
AgeCommit message (Collapse)AuthorLines
2020-09-04rustc_expand: remove pub visibility for rustfmtCaleb Cartwright-2/+1
2020-09-04Detect overflow in proc_macro_server subspanTomasz Miąsko-2/+2
2020-09-03Optimize Cursor::look_aheadAleksey Kladov-3/+8
Cloning a tt is cheap, but not free (there's Arc inside).
2020-09-03Rename IsJoint -> SpacingAleksey Kladov-8/+8
To match better naming from proc-macro
2020-09-03Move jointness censoring to proc_macroAleksey Kladov-4/+11
Proc-macro API currently exposes jointness in `Punct` tokens. That is, `+` in `+one` is **non** joint. Our lexer produces jointness info for all tokens, so we need to censor it *somewhere* Previously we did this in a lexer, but it makes more sense to do this in a proc-macro server.
2020-09-02Auto merge of #76170 - matklad:notrivia, r=petrochenkovbors-1/+1
Remove trivia tokens r? @ghost
2020-09-01Rollup merge of #76132 - Aaron1011:mac-call-stmt, r=petrochenkovTyler Mandry-4/+8
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-09-01Auto merge of #76010 - Aaron1011:fix/cfg-generic-param, r=petrochenkovbors-4/+7
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-01Remove trivia tokensAleksey Kladov-1/+1
2020-08-31Rollup merge of #76050 - matklad:pos, r=petrochenkovAleksey Kladov-257/+0
Remove unused function
2020-08-30Add `-Z proc-macro-backtrace` to allow showing proc-macro panicsAaron Hill-19/+24
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-30Factor out StmtKind::MacCall fields into `MacCallStmt` structAaron Hill-4/+8
In PR #76130, I add a fourth field, which makes using a tuple variant somewhat unwieldy.
2020-08-30Move lexer unit tests to rustc_lexerAleksey Kladov-257/+0
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-30Run cfg-stripping on generic parameters before invoking derive macrosAaron Hill-4/+7
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-30mv compiler to compiler/mark-0/+11065