]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-link_args.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / feature-gates / feature-gate-link_args.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Test that `#[link_args]` attribute is gated by `link_args`
12 // feature gate, both when it occurs where expected (atop
13 // `extern { }` blocks) and where unexpected.
14
15 // sidestep warning (which is correct, but misleading for
16 // purposes of this test)
17 #![allow(unused_attributes)]
18
19 #![link_args = "-l unexpected_use_as_inner_attr_on_mod"]
20 //~^ ERROR the `link_args` attribute is experimental
21
22 #[link_args = "-l expected_use_case"]
23 //~^ ERROR the `link_args` attribute is experimental
24 extern {}
25
26 #[link_args = "-l unexected_use_on_non_extern_item"]
27 //~^ ERROR: the `link_args` attribute is experimental
28 fn main() {}