]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
3b2f2976
XL
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?
9fa01778 9#![inline]
3b2f2976 10
9fa01778 11#[inline]
83c7162d 12//~^ ERROR attribute should be applied to function or closure
3b2f2976 13mod inline {
9fa01778 14 mod inner { #![inline] }
83c7162d 15 //~^ ERROR attribute should be applied to function or closure
3b2f2976
XL
16
17 #[inline = "2100"] fn f() { }
60c5eb7d 18 //~^ ERROR attribute must be of the form
9fa01778 19 //~| WARN this was previously accepted
3b2f2976 20
9fa01778 21 #[inline] struct S;
83c7162d 22 //~^ ERROR attribute should be applied to function or closure
3b2f2976 23
9fa01778 24 #[inline] type T = S;
83c7162d 25 //~^ ERROR attribute should be applied to function or closure
3b2f2976 26
9fa01778 27 #[inline] impl S { }
83c7162d 28 //~^ ERROR attribute should be applied to function or closure
3b2f2976 29}
0531ce1d
XL
30
31fn main() {}