fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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