When needing type annotations in local bindings, account for impl Trait and closures

Do not suggest nonsensical types when the type inference is failing on
`impl Trait` or anonymous closures.
This commit is contained in:
Esteban Küber
2019-08-12 16:50:46 -07:00
parent 60960a260f
commit b8708e2c9a
7 changed files with 97 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
// edition:2018
#![feature(async_await)]
use std::io::Error;
fn make_unit() -> Result<(), Error> {
Ok(())
}
fn main() {
let fut = async {
make_unit()?; //~ ERROR type annotations needed
Ok(())
};
}