]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rust-2018/async-ident.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / rust-2018 / async-ident.rs
CommitLineData
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
7fn async() {} //~ ERROR async
136023e0 8//~^ WARN this is accepted in the current edition
8faf50e0
XL
9
10macro_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
19foo!(async);
b7449926 20 //~^ ERROR async
136023e0 21 //~| WARN this is accepted in the current edition
8faf50e0
XL
22
23mod dont_lint_raw {
24 fn r#async() {}
25}
26
27mod 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
37mod async_static {
38 static async: u32 = 0;
39 //~^ ERROR async
136023e0 40 //~| WARN this is accepted in the current edition
8faf50e0
XL
41}
42
43mod async_const {
44 const async: u32 = 0;
45 //~^ ERROR async
136023e0 46 //~| WARN this is accepted in the current edition
8faf50e0
XL
47}
48
49struct Foo;
50impl Foo { fn async() {} }
51 //~^ ERROR async
136023e0 52 //~| WARN this is accepted in the current edition
8faf50e0
XL
53
54fn 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]
68macro_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]
75macro_rules! consumes_async {
76 (async) => (1)
77 //~^ ERROR async
136023e0 78 //~| WARN this is accepted in the current edition
8faf50e0 79}