]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/unresolved_type_param.rs
Rollup merge of #69625 - Stebalien:feat/iter-copy-specialize, r=KodrAus
[rust.git] / src / test / ui / async-await / unresolved_type_param.rs
1 // Provoke an unresolved type error (T).
2 // Error message should pinpoint the type parameter T as needing to be bound
3 // (rather than give a general error message)
4 // edition:2018
5
6 async fn bar<T>() -> () {}
7
8 async fn foo() {
9     bar().await;
10     //~^ ERROR type inside `async fn` body must be known in this context
11     //~| ERROR type inside `async fn` body must be known in this context
12     //~| ERROR type inside `async fn` body must be known in this context
13     //~| NOTE cannot infer type for type parameter `T`
14     //~| NOTE cannot infer type for type parameter `T`
15     //~| NOTE cannot infer type for type parameter `T`
16     //~| NOTE the type is part of the `async fn` body because of this `await`
17     //~| NOTE the type is part of the `async fn` body because of this `await`
18     //~| NOTE the type is part of the `async fn` body because of this `await`
19     //~| NOTE in this expansion of desugaring of `await`
20     //~| NOTE in this expansion of desugaring of `await`
21     //~| NOTE in this expansion of desugaring of `await`
22 }
23 fn main() {}