From 60be2f52d2434dfbf2df7728454d572d76f58bf8 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 31 Dec 2014 20:43:46 -0800 Subject: Replace #[phase] with #[plugin] / #[macro_use] / #[no_link] --- src/libsyntax/feature_gate.rs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/libsyntax/feature_gate.rs') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f8ac34cfe29..e41fef4e778 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -44,7 +44,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("non_ascii_idents", Active), ("thread_local", Active), ("link_args", Active), - ("phase", Active), + ("phase", Active), // NOTE(stage0): switch to Removed after next snapshot ("plugin_registrar", Active), ("log_syntax", Active), ("trace_macros", Active), @@ -74,6 +74,8 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("if_let", Accepted), ("while_let", Accepted), + ("plugin", Active), + // A temporary feature gate used to enable parser extensions needed // to bootstrap fix for #5723. ("issue_5723_bootstrap", Accepted), @@ -163,22 +165,6 @@ struct MacroVisitor<'a> { } impl<'a, 'v> Visitor<'v> for MacroVisitor<'a> { - fn visit_view_item(&mut self, i: &ast::ViewItem) { - match i.node { - ast::ViewItemExternCrate(..) => { - for attr in i.attrs.iter() { - if attr.name().get() == "phase"{ - self.context.gate_feature("phase", attr.span, - "compile time crate loading is \ - experimental and possibly buggy"); - } - } - }, - _ => { } - } - visit::walk_view_item(self, i) - } - fn visit_mac(&mut self, macro: &ast::Mac) { let ast::MacInvocTT(ref path, _, _) = macro.node; let id = path.segments.last().unwrap().identifier; @@ -241,10 +227,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } ast::ViewItemExternCrate(..) => { for attr in i.attrs.iter() { - if attr.name().get() == "phase"{ - self.gate_feature("phase", attr.span, - "compile time crate loading is \ - experimental and possibly buggy"); + if attr.check_name("plugin") { + self.gate_feature("plugin", attr.span, + "compiler plugins are experimental \ + and possibly buggy"); } } } -- cgit 1.4.1-3-g733a5