Uh oh!
There was an error while loading. Please reload this page.
rustc: Disallow modules and macros in expansions - #50820
Conversation
rust-highfive
commented
May 17, 2018
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
May 17, 2018
rust-highfive
commented
May 17, 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 |
petrochenkov
commented
May 17, 2018
Couple of tests? |
alexcrichton
commented
May 17, 2018
@bors: r=petrochenkov |
bors
commented
May 17, 2018
📌 Commit 81fc850 has been approved by |
kennytm
commented
May 17, 2018
@bors r-
Details |
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
alexcrichton
commented
May 18, 2018
@bors: r=petrochenkov |
bors
commented
May 18, 2018
📌 Commit 5e4bac3 has been approved by |
bors
commented
May 20, 2018
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
bors
commented
May 20, 2018
☀️ Test successful - status-appveyor, status-travis |
sgrif
commented
Sep 3, 2018
Since #51952 landed, do we still need this feature gate? It looks like the underlying problem has now been fixed. |
petrochenkov
commented
Sep 3, 2018
sgrif
commented
Sep 6, 2018
Thanks |
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.
cc #50504