From a0958048b6b31c3a2ac9242aac699791431955de Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 14 May 2018 03:22:52 +0300 Subject: Stabilize `use_extern_macros` --- src/libsyntax/ext/expand.rs | 12 ++---------- src/libsyntax/feature_gate.rs | 18 ++++-------------- 2 files changed, 6 insertions(+), 24 deletions(-) (limited to 'src/libsyntax') 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 395e5c98652..6fec1f3b1d5 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 -- cgit 1.4.1-3-g733a5