Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Disallow modules and macros in expansions #50820

Merged
merged 1 commit into from
May 20, 2018

Commits on May 18, 2018

  1. 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 (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 committed May 18, 2018
    Configuration menu
    Copy the full SHA
    5e4bac3 View commit details
    Browse the repository at this point in the history