]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-64130-4-async-move.rs
Change inference var check to be in project_type
[rust.git] / src / test / ui / async-await / issue-64130-4-async-move.rs
1 // edition:2018
2 use std::any::Any;
3 use std::future::Future;
4
5 struct Client(Box<dyn Any + Send>);
6
7 impl Client {
8     fn status(&self) -> u16 {
9         200
10     }
11 }
12
13 async fn get() { }
14
15 pub fn foo() -> impl Future + Send {
16     //~^ ERROR future cannot be sent between threads safely
17     let client = Client(Box::new(true));
18     async move {
19         match client.status() {
20             200 => {
21                 let _x = get().await;
22             },
23             _ => (),
24         }
25     }
26 }
27
28 fn main() {}