about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-16 08:26:38 +0200
committerGitHub <noreply@github.com>2019-08-16 08:26:38 +0200
commitd9a429a1eb42ba56e1fa770c90305011efcac4d6 (patch)
tree90c9b00e6f322de3acc011afafcf86b2301c94a1 /src/libsyntax/parse/parser
parent6e9e6ea39bbc2c9e58cdc854c55dfc1487a77ae1 (diff)
parent9287eb647f7168a65950965044bd5e22d1b05faf (diff)
downloadrust-d9a429a1eb42ba56e1fa770c90305011efcac4d6.tar.gz
rust-d9a429a1eb42ba56e1fa770c90305011efcac4d6.zip
Rollup merge of #63539 - Centril:2015.await, r=oli-obk
Suggest Rust 2018 on `<expr>.await` with no such field

When type checking a field projection (`fn check_field`) to `<expr>.await` where `<expr>: τ` and `τ` is not a primitive type, suggest switching to Rust 2018. E.g.

```
error[E0609]: no field `await` on type `std::pin::Pin<&mut dyn std::future::Future<Output = ()>>`
  --> $DIR/suggest-switching-edition-on-await.rs:31:7
   |
LL |     x.await;
   |       ^^^^^ unknown field
   |
   = note: to `.await` a `Future`, switch to Rust 2018
   = help: set `edition = "2018"` in `Cargo.toml`
   = note: for more on editions, read https://doc.rust-lang.org/edition-guide
```

Fixes https://github.com/rust-lang/rust/issues/63533

This PR also performs some preparatory cleanups in `fn check_field`; the last 2 commits are where the suggestion is introduced and tested respectively.

r? @varkor
Diffstat (limited to 'src/libsyntax/parse/parser')
0 files changed, 0 insertions, 0 deletions