]> git.proxmox.com Git - rustc.git/blob - src/test/ui/feature-gate/issue-43106-gating-of-inline.rs
New upstream version 1.26.0+dfsg1
[rustc.git] / src / test / ui / feature-gate / issue-43106-gating-of-inline.rs
1 // Copyright 2017 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 // This is testing whether `#[inline]` signals an error or warning
12 // when put in "weird" places.
13 //
14 // (This file sits on its own because it actually signals an error,
15 // which would mess up the treatment of other cases in
16 // issue-43106-gating-of-builtin-attrs.rs)
17
18 // Crate-level is accepted, though it is almost certainly unused?
19 #![inline = "2100"]
20
21 #[inline = "2100"]
22 //~^ ERROR attribute should be applied to function
23 mod inline {
24 mod inner { #![inline="2100"] }
25 //~^ ERROR attribute should be applied to function
26
27 #[inline = "2100"] fn f() { }
28
29 #[inline = "2100"] struct S;
30 //~^ ERROR attribute should be applied to function
31
32 #[inline = "2100"] type T = S;
33 //~^ ERROR attribute should be applied to function
34
35 #[inline = "2100"] impl S { }
36 //~^ ERROR attribute should be applied to function
37 }
38
39 fn main() {}