]> git.lizzy.rs Git - rust.git/blob - src/test/ui/await-keyword/2015-edition-error-in-non-macro-position.rs
Rollup merge of #60627 - matklad:test, r=estebank
[rust.git] / src / test / ui / await-keyword / 2015-edition-error-in-non-macro-position.rs
1 #![feature(async_await, await_macro)]
2 #![allow(non_camel_case_types)]
3 #![deny(keyword_idents)]
4
5 mod outer_mod {
6     pub mod await { //~ ERROR `await` is a keyword in the 2018 edition
7     //~^ WARN this was previously accepted by the compiler
8         pub struct await; //~ ERROR `await` is a keyword in the 2018 edition
9         //~^ WARN this was previously accepted by the compiler
10     }
11 }
12 use outer_mod::await::await; //~ ERROR `await` is a keyword in the 2018 edition
13 //~^ ERROR `await` is a keyword in the 2018 edition
14 //~^^ WARN this was previously accepted by the compiler
15 //~^^^ WARN this was previously accepted by the compiler
16
17 struct Foo { await: () }
18 //~^ ERROR `await` is a keyword in the 2018 edition
19 //~^^ WARN this was previously accepted by the compiler
20
21 impl Foo { fn await() {} }
22 //~^ ERROR `await` is a keyword in the 2018 edition
23 //~^^ WARN this was previously accepted by the compiler
24
25 macro_rules! await {
26 //~^ ERROR `await` is a keyword in the 2018 edition
27 //~^^ WARN this was previously accepted by the compiler
28     () => {}
29 }
30
31 fn main() {
32     match await { await => {} } //~ ERROR `await` is a keyword in the 2018 edition
33     //~^ ERROR `await` is a keyword in the 2018 edition
34     //~^^ WARN this was previously accepted by the compiler
35     //~^^^ WARN this was previously accepted by the compiler
36 }