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:
16
src/test/ui/inference/cannot-infer-async.rs
Normal file
16
src/test/ui/inference/cannot-infer-async.rs
Normal 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(())
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user