Uh oh!
There was an error while loading. Please reload this page.
WIP: Gate generating mod items in procedural macros - #50587
Conversation
rust-highfive
commented
May 9, 2018
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
May 9, 2018
@bors: try |
alexcrichton
commented
May 9, 2018
@rust-lang/infra, could this be queued up for a check-only crater run? |
bors
commented
May 9, 2018
⌛ Trying commit bf3a1f146ad648bca69083a52dea192ba7a65e1f with merge d8c55432067be68f5e33e1472daddd580de55bca... |
alexcrichton
commented
May 9, 2018
@bors: try |
bors
commented
May 9, 2018
⌛ Trying commit 37b3c5e with merge d5fe9545473461c4b00b487ae07543b8d8646f3c... |
rust-highfive
commented
May 9, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
May 10, 2018
☀️ Test successful - status-travis |
aidanhs
commented
May 12, 2018
Crater run started. |
petrochenkov
commented
May 16, 2018
@alexcrichton |
Mark-Simulacrum
commented
May 17, 2018
Crater run finished: https://cargobomb-reports.s3.amazonaws.com/pr-50587/index.html. |
alexcrichton
commented
May 17, 2018
Alrighty-roo, thanks @Mark-Simulacrum! Definitely seems like we can't land this as-is, I'll file a follow-up. |
This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (rust-lang#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: rust-lang#50504 (comment) cc rust-lang#50504
rustc: Disallow modules and macros in expansions This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: #50504 (comment) cc #50504
Discovered in #50504 the hygiene here is super questionable, so we'll likely want to gate this by default for procedural macros and procedural attributes for sure. This is a PR to evaluate the impact for procedural derive as well.