diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-01-01 16:14:35 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-01-02 12:13:30 -0800 |
| commit | 045f8f69293fae924ee4998439ec0e34f98320be (patch) | |
| tree | e1f319b047028fd4fd66a708ed1274fb4d127384 /src/libsyntax_ext | |
| parent | 917e5baae7ff931b13a8b40d2fce60395fefe7a4 (diff) | |
| download | rust-045f8f69293fae924ee4998439ec0e34f98320be.tar.gz rust-045f8f69293fae924ee4998439ec0e34f98320be.zip | |
rustc: Stabilize the `proc_macro` feature
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the compiler to stabilize the "Macros 1.1" feature of the language. Many more details can be found on the tracking issue, #35900. Closes #35900
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/mod.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax_ext/lib.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax_ext/proc_macro_registrar.rs | 10 |
3 files changed, 2 insertions, 17 deletions
diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 0511b0d252b..2573690d153 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -15,7 +15,7 @@ use syntax::attr::HasAttrs; use syntax::codemap; use syntax::ext::base::{Annotatable, ExtCtxt, SyntaxExtension}; use syntax::ext::build::AstBuilder; -use syntax::feature_gate::{self, emit_feature_err}; +use syntax::feature_gate; use syntax::ptr::P; use syntax::symbol::Symbol; use syntax_pos::Span; @@ -220,12 +220,6 @@ pub fn expand_derive(cx: &mut ExtCtxt, .filter(|&(_, ref name)| !is_builtin_trait(name.name().unwrap())) .next(); if let Some((i, titem)) = macros_11_derive { - if !cx.ecfg.features.unwrap().proc_macro { - let issue = feature_gate::GateIssue::Language; - let msg = "custom derive macros are experimentally supported"; - emit_feature_err(cx.parse_sess, "proc_macro", titem.span, issue, msg); - } - let tname = ast::Ident::with_empty_ctxt(titem.name().unwrap()); let path = ast::Path::from_ident(titem.span, tname); let ext = cx.resolver.resolve_macro(cx.current_expansion.mark, &path, false).unwrap(); diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index e31b29d5cc1..cbc2b2263f2 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -19,7 +19,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] -#![feature(proc_macro_lib)] #![feature(proc_macro_internals)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/libsyntax_ext/proc_macro_registrar.rs b/src/libsyntax_ext/proc_macro_registrar.rs index 5323ace79d8..c93e2c054d2 100644 --- a/src/libsyntax_ext/proc_macro_registrar.rs +++ b/src/libsyntax_ext/proc_macro_registrar.rs @@ -17,7 +17,6 @@ use syntax::ext::base::ExtCtxt; use syntax::ext::build::AstBuilder; use syntax::ext::expand::ExpansionConfig; use syntax::parse::ParseSess; -use syntax::feature_gate::Features; use syntax::fold::Folder; use syntax::ptr::P; use syntax::symbol::Symbol; @@ -47,8 +46,7 @@ pub fn modify(sess: &ParseSess, is_proc_macro_crate: bool, is_test_crate: bool, num_crate_types: usize, - handler: &errors::Handler, - features: &Features) -> ast::Crate { + handler: &errors::Handler) -> ast::Crate { let ecfg = ExpansionConfig::default("proc_macro".to_string()); let mut cx = ExtCtxt::new(sess, ecfg, resolver); @@ -66,12 +64,6 @@ pub fn modify(sess: &ParseSess, if !is_proc_macro_crate { return krate - } else if !features.proc_macro { - let mut err = handler.struct_err("the `proc-macro` crate type is \ - experimental"); - err.help("add #![feature(proc_macro)] to the crate attributes to \ - enable"); - err.emit(); } if num_crate_types > 1 { |
