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