From c512dea1ed4d97792c831eb2d8ec4725e32ac14d Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 7 Jul 2017 16:09:46 +0200 Subject: Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute. Extend the gating test to include the attribute in "weird" places. --- src/libsyntax/feature_gate.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/libsyntax/feature_gate.rs') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index cb625b1ac06..9448d8a20a3 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -552,7 +552,12 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG ("ignore", Normal, Ungated), ("no_implicit_prelude", Normal, Ungated), ("reexport_test_harness_main", Normal, Ungated), - ("link_args", Normal, Ungated), + ("link_args", Normal, Gated(Stability::Unstable, + "link_args", + "the `link_args` attribute is experimental and not \ + portable across platforms, it is recommended to \ + use `#[link(name = \"foo\")] instead", + cfg_fn!(link_args))), ("macro_escape", Normal, Ungated), // RFC #1445. @@ -1185,12 +1190,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } ast::ItemKind::ForeignMod(ref foreign_module) => { - if attr::contains_name(&i.attrs[..], "link_args") { - gate_feature_post!(&self, link_args, i.span, - "the `link_args` attribute is not portable \ - across platforms, it is recommended to \ - use `#[link(name = \"foo\")]` instead") - } self.check_abi(foreign_module.abi, i.span); } -- cgit 1.4.1-3-g733a5