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/test/compile-fail/gated-link-args.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/gated-link-args.rs b/src/test/compile-fail/gated-link-args.rs index d34057e290e..82f5db3042b 100644 --- a/src/test/compile-fail/gated-link-args.rs +++ b/src/test/compile-fail/gated-link-args.rs @@ -9,12 +9,22 @@ // except according to those terms. // Test that `#[link_args]` attribute is gated by `link_args` -// feature gate. +// feature gate, both when it occurs where expected (atop +// `extern { }` blocks) and where unexpected. // gate-test-link_args -#[link_args = "aFdEfSeVEEE"] +// sidestep warning (which is correct, but misleading for +// purposes of this test) +#![allow(unused_attributes)] + +#![link_args = "-l unexpected_use_as_inner_attr_on_mod"] +//~^ ERROR the `link_args` attribute is experimental + +#[link_args = "-l expected_use_case"] +//~^ ERROR the `link_args` attribute is experimental extern {} -//~^ ERROR the `link_args` attribute is not portable across platforms -fn main() { } +#[link_args = "-l unexected_use_on_non_extern_item"] +//~^ ERROR: the `link_args` attribute is experimental +fn main() {} -- cgit 1.4.1-3-g733a5