summary refs log tree commit diff
path: root/compiler/rustc_expand/src/proc_macro.rs
AgeCommit message (Collapse)AuthorLines
2021-03-15Extend `proc_macro_back_compat` lint to `procedural-masquerade`Aaron Hill-1/+2
We now lint on *any* use of `procedural-masquerade` crate. While this crate still exists, its main reverse dependency (`cssparser`) no longer depends on it. Any crates still depending off should stop doing so, as it only exists to support very old Rust versions. If a crate actually needs to support old versions of rustc via `procedural-masquerade`, then they'll just need to accept the warning until we remove it entirely (at the same time as the back-compat hack). The latest version of `procedural-masquerade` does not work with the latest rustc, but trying to check for the version seems like more trouble than it's worth. While working on this, I realized that the `proc-macro-hack` check was never actually doing anything. The corresponding enum variant in `proc-macro-hack` is named `Value` or `Nested` - it has never been called `Input`. Due to a strange Crater issue, the Crater run that tested adding this did *not* end up testing it - some of the crates that would have failed did not actually have their tests checked, making it seem as though the `proc-macro-hack` check was working. The Crater issue is being discussed at https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Nearly.20identical.20Crater.20runs.20processed.20a.20crate.20differently/near/230406661 Despite the `proc-macro-hack` check not actually doing anything, we haven't gotten any reports from users about their build being broken. I went ahead and removed it entirely, since it's clear that no one is being affected by the `proc-macro-hack` regression in practice.
2021-02-07expand/resolve: Turn `#[derive]` into a regular macro attributeVadim Petrochenkov-92/+2
2021-01-20Force token collection to run when parsing nonterminalsAaron Hill-1/+2
Fixes #81007 Previously, we would fail to collect tokens in the proper place when only builtin attributes were present. As a result, we would end up with attribute tokens in the collected `TokenStream`, leading to duplication when we attempted to prepend the attributes from the AST node. We now explicitly track when token collection must be performed due to nomterminal parsing.
2021-01-07rustc_parse: Better spans for synthesized token streamsVadim Petrochenkov-6/+1
2020-12-29Remove pretty-print/reparse hack, and add derive-specific hackAaron Hill-2/+7
2020-11-24Invoke attributes on the statement for statement itemsAaron Hill-1/+20
2020-11-19expand: Mark some dead code in derive expansion as unreachableVadim Petrochenkov-31/+2
2020-10-02Improve E0777 help messageGuillaume Gomez-4/+13
2020-10-01Create E0777 error code for "invalid literal in derive"Guillaume Gomez-4/+9
2020-08-30Add `-Z proc-macro-backtrace` to allow showing proc-macro panicsAaron Hill-19/+22
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-30mv compiler to compiler/mark-0/+224