]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/unresolved_type_param.rs
Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisa
[rust.git] / tests / 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 // compile-flags: -Zdrop-tracking
6
7 async fn bar<T>() -> () {}
8
9 async fn foo() {
10     bar().await;
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     //~| ERROR type inside `async fn` body must be known in this context
14     //~| NOTE cannot infer type for type parameter `T`
15     //~| NOTE cannot infer type for type parameter `T`
16     //~| NOTE cannot infer type for type parameter `T`
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 the type is part of the `async fn` body because of this `await`
20     //~| NOTE in this expansion of desugaring of `await`
21     //~| NOTE in this expansion of desugaring of `await`
22     //~| NOTE in this expansion of desugaring of `await`
23 }
24 fn main() {}