about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-10 15:39:47 +0000
committerbors <bors@rust-lang.org>2017-07-10 15:39:47 +0000
commiteb9dfb8bd9444d01fc129bfaac180b913299486b (patch)
tree3e320dced01e40a8061215b19cd8eb4de0445196 /src/test
parentd84693b93dae3958e3504f817face0184c5c3fdd (diff)
parentc512dea1ed4d97792c831eb2d8ec4725e32ac14d (diff)
downloadrust-eb9dfb8bd9444d01fc129bfaac180b913299486b.tar.gz
rust-eb9dfb8bd9444d01fc129bfaac180b913299486b.zip
Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis
Fix feature gate for `#[link_args(..)]` attribute

Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute.

See also #29596 and #43106
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/gated-link-args.rs18
1 files changed, 14 insertions, 4 deletions
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() {}