diff options
| author | bors <bors@rust-lang.org> | 2018-08-17 19:10:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-17 19:10:34 +0000 |
| commit | c8c587fe4ea43afb1c3cf9fe008101f09003ccd1 (patch) | |
| tree | 3ac680db941a34ceb9e74527b39887f3c36d0751 /src/libsyntax | |
| parent | de21ea8ff536430885d50e882026953c2f0684d4 (diff) | |
| parent | 674a5db1a50e25dd60a8ee6669edee9a366c9fab (diff) | |
| download | rust-c8c587fe4ea43afb1c3cf9fe008101f09003ccd1.tar.gz rust-c8c587fe4ea43afb1c3cf9fe008101f09003ccd1.zip | |
Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 18 |
2 files changed, 6 insertions, 24 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index f7ea781e021..90b46268045 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1124,9 +1124,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { return attrs; } - if self.cx.ecfg.use_extern_macros_enabled() { - attr = find_attr_invoc(&mut attrs); - } + attr = find_attr_invoc(&mut attrs); traits = collect_derives(&mut self.cx, &mut attrs); attrs }); @@ -1147,9 +1145,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { return attrs; } - if self.cx.ecfg.use_extern_macros_enabled() { - attr = find_attr_invoc(&mut attrs); - } + attr = find_attr_invoc(&mut attrs); attrs }); @@ -1667,10 +1663,6 @@ impl<'feat> ExpansionConfig<'feat> { fn proc_macro_expr = proc_macro_expr, fn proc_macro_non_items = proc_macro_non_items, } - - pub fn use_extern_macros_enabled(&self) -> bool { - self.features.map_or(false, |features| features.use_extern_macros()) - } } // A Marker adds the given mark to the syntax context. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 7a8a7b07318..ed6321f6a45 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -81,17 +81,6 @@ macro_rules! declare_features { { $(f(stringify!($feature), self.$feature);)+ } - - pub fn use_extern_macros(&self) -> bool { - // A number of "advanced" macro features enable - // macro modularization (`use_extern_macros`) implicitly. - self.use_extern_macros || self.decl_macro || - self.tool_attributes || self.custom_attribute || - self.macros_in_extern || self.proc_macro_path_invoc || - self.proc_macro_mod || self.proc_macro_expr || - self.proc_macro_non_items || self.proc_macro_gen || - self.stmt_expr_attributes || self.unrestricted_attribute_tokens - } } }; @@ -308,8 +297,6 @@ declare_features! ( // Allows #[link(..., cfg(..))] (active, link_cfg, "1.14.0", Some(37406), None), - (active, use_extern_macros, "1.15.0", Some(35896), Some(Edition::Edition2018)), - // `extern "ptx-*" fn()` (active, abi_ptx, "1.15.0", Some(38788), None), @@ -535,7 +522,7 @@ declare_features! ( (removed, advanced_slice_patterns, "1.0.0", Some(23121), None, Some("merged into `#![feature(slice_patterns)]`")), (removed, macro_reexport, "1.0.0", Some(29638), None, - Some("subsumed by `#![feature(use_extern_macros)]` and `pub use`")), + Some("subsumed by `pub use`")), ); declare_features! ( @@ -652,6 +639,9 @@ declare_features! ( (accepted, repr_transparent, "1.28.0", Some(43036), None), // Defining procedural macros in `proc-macro` crates (accepted, proc_macro, "1.29.0", Some(38356), None), + // Allows importing and reexporting macros with `use`, + // enables macro modularization in general. + (accepted, use_extern_macros, "1.30.0", Some(35896), None), ); // If you change this, please modify src/doc/unstable-book as well. You must |
