diff options
| author | bors <bors@rust-lang.org> | 2018-05-20 05:57:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-20 05:57:41 +0000 |
| commit | ccb5e973f7546cef6c389a5378cdfbf2fcb595f1 (patch) | |
| tree | 0f52d956edc7676181f0b045f19943fdf526a8a9 /src/libsyntax/feature_gate.rs | |
| parent | 522aa5e00bde42fa8ad380b30763ed4921a7c3a0 (diff) | |
| parent | 5e4bac31b82241db4ca8e9234a4f368c30e8966a (diff) | |
| download | rust-ccb5e973f7546cef6c389a5378cdfbf2fcb595f1.tar.gz rust-ccb5e973f7546cef6c389a5378cdfbf2fcb595f1.zip | |
Auto merge of #50820 - alexcrichton:no-modules, r=petrochenkov
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]: https://github.com/rust-lang/rust/issues/50504#issuecomment-387734625 cc #50504
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index d247b5402ef..604df862dc2 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -451,6 +451,7 @@ declare_features! ( (active, proc_macro_mod, "1.27.0", None, None), (active, proc_macro_expr, "1.27.0", None, None), (active, proc_macro_non_items, "1.27.0", None, None), + (active, proc_macro_gen, "1.27.0", None, None), // #[doc(alias = "...")] (active, doc_alias, "1.27.0", Some(50146), None), |
