]> git.proxmox.com Git - rustc.git/blob - src/test/ui/feature-gate/issue-43106-gating-of-inline.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / test / ui / feature-gate / issue-43106-gating-of-inline.rs
1 // This is testing whether `#[inline]` signals an error or warning
2 // when put in "weird" places.
3 //
4 // (This file sits on its own because it actually signals an error,
5 // which would mess up the treatment of other cases in
6 // issue-43106-gating-of-builtin-attrs.rs)
7
8 // Crate-level is accepted, though it is almost certainly unused?
9 #![inline]
10
11 #[inline]
12 //~^ ERROR attribute should be applied to function or closure
13 mod inline {
14 mod inner { #![inline] }
15 //~^ ERROR attribute should be applied to function or closure
16
17 #[inline = "2100"] fn f() { }
18 //~^ ERROR attribute must be of the form
19 //~| WARN this was previously accepted
20
21 #[inline] struct S;
22 //~^ ERROR attribute should be applied to function or closure
23
24 #[inline] type T = S;
25 //~^ ERROR attribute should be applied to function or closure
26
27 #[inline] impl S { }
28 //~^ ERROR attribute should be applied to function or closure
29 }
30
31 fn main() {}