fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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