diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-01-13 17:30:17 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-01-21 16:27:26 +0200 |
| commit | 7cece8725b6a7e12045bdbff257ecec7327654bf (patch) | |
| tree | 1df923982bcf420b67ad7c9c6f4684b652935d83 /src/libsyntax/feature_gate.rs | |
| parent | 38ac9e3984392ab11e33b77d5e1927c1fa17fb07 (diff) | |
| download | rust-7cece8725b6a7e12045bdbff257ecec7327654bf.tar.gz rust-7cece8725b6a7e12045bdbff257ecec7327654bf.zip | |
syntax: fix fallout of merging ast::ViewItem into ast::Item.
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 6ab31c63a14..762a1dcbfc3 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -226,22 +226,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } } - fn visit_view_item(&mut self, i: &ast::ViewItem) { - match i.node { - ast::ViewItemUse(..) => {} - ast::ViewItemExternCrate(..) => { - for attr in i.attrs.iter() { - if attr.check_name("plugin") { - self.gate_feature("plugin", attr.span, - "compiler plugins are experimental \ - and possibly buggy"); - } - } - } - } - visit::walk_view_item(self, i) - } - fn visit_item(&mut self, i: &ast::Item) { for attr in i.attrs.iter() { if attr.name() == "thread_local" { @@ -260,6 +244,14 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } } match i.node { + ast::ItemExternCrate(_) => { + if attr::contains_name(&i.attrs[], "plugin") { + self.gate_feature("plugin", i.span, + "compiler plugins are experimental \ + and possibly buggy"); + } + } + ast::ItemForeignMod(ref foreign_module) => { if attr::contains_name(&i.attrs[], "link_args") { self.gate_feature("link_args", i.span, |
