]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/suggest-switching-edition-on-await.rs
2 use std
::future
::Future
;
6 fn await_on_struct_missing() {
10 //~^ ERROR no field `await` on type
11 //~| NOTE unknown field
12 //~| NOTE to `.await` a `Future`, switch to Rust 2018
13 //~| HELP set `edition = "2021"` in `Cargo.toml`
14 //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
17 fn await_on_struct_similar() {
21 let x
= S { awai: 42 }
;
23 //~^ ERROR no field `await` on type
24 //~| HELP a field with a similar name exists
25 //~| NOTE to `.await` a `Future`, switch to Rust 2018
26 //~| HELP set `edition = "2021"` in `Cargo.toml`
27 //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
30 fn await_on_63533(x
: Pin
<&mut dyn Future
<Output
= ()>>) {
32 //~^ ERROR no field `await` on type
33 //~| NOTE unknown field
34 //~| NOTE to `.await` a `Future`, switch to Rust 2018
35 //~| HELP set `edition = "2021"` in `Cargo.toml`
36 //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
39 fn await_on_apit(x
: impl Future
<Output
= ()>) {
41 //~^ ERROR no field `await` on type
42 //~| NOTE to `.await` a `Future`, switch to Rust 2018
43 //~| HELP set `edition = "2021"` in `Cargo.toml`
44 //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide