Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
47b99485a391e21caf3e0312969ed00ccbc6c167
rust/src/test/ui/inference/cannot-infer-async.rs

16 lines
205 B
Rust
Raw Normal View History

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.
2019-08-12 16:50:46 -07:00
// edition:2018
use std::io::Error;
Fix tidy
2019-08-12 18:42:19 -07:00
fn make_unit() -> Result<(), Error> {
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.
2019-08-12 16:50:46 -07:00
Ok(())
}
fn main() {
let fut = async {
make_unit()?; //~ ERROR type annotations needed
Fix tidy
2019-08-12 18:42:19 -07:00
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.
2019-08-12 16:50:46 -07:00
Ok(())
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2092ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API