]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-error-span.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / async-await / async-error-span.rs
1 // revisions: no_drop_tracking drop_tracking drop_tracking_mir
2 // [drop_tracking] compile-flags: -Zdrop-tracking
3 // [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
4 // edition:2018
5
6 // Regression test for issue #62382.
7
8 use std::future::Future;
9
10 fn get_future() -> impl Future<Output = ()> {
11 //~^ ERROR `()` is not a future
12     panic!()
13 }
14
15 async fn foo() {
16     let a;
17     //[no_drop_tracking,drop_tracking]~^ ERROR type inside `async fn` body must be known in this context
18     //[drop_tracking_mir]~^^ ERROR type annotations needed
19     get_future().await;
20 }
21
22 fn main() {}