]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | #![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)] |
b7449926 | 2 | #![deny(keyword_idents)] |
8faf50e0 XL |
3 | |
4 | // edition:2015 | |
5 | // run-rustfix | |
6 | ||
7 | fn async() {} //~ ERROR async | |
136023e0 | 8 | //~^ WARN this is accepted in the current edition |
8faf50e0 XL |
9 | |
10 | macro_rules! foo { | |
11 | ($foo:ident) => {}; | |
12 | ($async:expr, async) => {}; | |
13 | //~^ ERROR async | |
14 | //~| ERROR async | |
136023e0 XL |
15 | //~| WARN this is accepted in the current edition |
16 | //~| WARN this is accepted in the current edition | |
8faf50e0 XL |
17 | } |
18 | ||
19 | foo!(async); | |
b7449926 | 20 | //~^ ERROR async |
136023e0 | 21 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
22 | |
23 | mod dont_lint_raw { | |
24 | fn r#async() {} | |
25 | } | |
26 | ||
27 | mod async_trait { | |
28 | trait async {} | |
29 | //~^ ERROR async | |
136023e0 | 30 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
31 | struct MyStruct; |
32 | impl async for MyStruct {} | |
33 | //~^ ERROR async | |
136023e0 | 34 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
35 | } |
36 | ||
37 | mod async_static { | |
38 | static async: u32 = 0; | |
39 | //~^ ERROR async | |
136023e0 | 40 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
41 | } |
42 | ||
43 | mod async_const { | |
44 | const async: u32 = 0; | |
45 | //~^ ERROR async | |
136023e0 | 46 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
47 | } |
48 | ||
49 | struct Foo; | |
50 | impl Foo { fn async() {} } | |
51 | //~^ ERROR async | |
136023e0 | 52 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
53 | |
54 | fn main() { | |
55 | struct async {} | |
56 | //~^ ERROR async | |
136023e0 | 57 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
58 | let async: async = async {}; |
59 | //~^ ERROR async | |
136023e0 | 60 | //~| WARN this is accepted in the current edition |
8faf50e0 | 61 | //~| ERROR async |
136023e0 | 62 | //~| WARN this is accepted in the current edition |
8faf50e0 | 63 | //~| ERROR async |
136023e0 | 64 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
65 | } |
66 | ||
67 | #[macro_export] | |
68 | macro_rules! produces_async { | |
69 | () => (pub fn async() {}) | |
70 | //~^ ERROR async | |
136023e0 | 71 | //~| WARN this is accepted in the current edition |
8faf50e0 XL |
72 | } |
73 | ||
74 | #[macro_export] | |
75 | macro_rules! consumes_async { | |
76 | (async) => (1) | |
77 | //~^ ERROR async | |
136023e0 | 78 | //~| WARN this is accepted in the current edition |
8faf50e0 | 79 | } |