]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-43988.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-43988.rs
1 // Copyright 2018 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 #![feature(stmt_expr_attributes)]
12
13 fn main() {
14
15     #[inline]
16     let _a = 4;
17     //~^^ ERROR attribute should be applied to function or closure
18
19
20     #[inline(XYZ)]
21     let _b = 4;
22     //~^^ ERROR attribute should be applied to function or closure
23
24     #[repr(nothing)]
25     let _x = 0;
26     //~^^ ERROR attribute should not be applied to a statement
27
28     #[repr(something_not_real)]
29     loop {
30         ()
31     };
32     //~^^^^ ERROR attribute should not be applied to an expression
33
34     #[repr]
35     let _y = "123";
36     //~^^ ERROR attribute should not be applied to a statement
37     //~| WARN `repr` attribute must have a hint
38
39
40     fn foo() {}
41
42     #[inline(ABC)]
43     foo();
44     //~^^ ERROR attribute should be applied to function or closure
45
46     let _z = #[repr] 1;
47     //~^ ERROR attribute should not be applied to an expression
48     //~| WARN `repr` attribute must have a hint
49 }