5 async fn foo(x: Option<bool>) {
16 fn is_send<T: Send>(_: T) {}
18 async fn foo2(x: Option<bool>) {
19 let Some(_) = x else {
20 bar2(Rc::new(())).await
24 async fn bar2<T>(_: T) -> ! {
28 async fn foo3(x: Option<bool>) {
29 let Some(_) = x else {
30 (Rc::new(()), bar().await);
35 async fn foo4(x: Option<bool>) {
36 let Some(_) = x else {
45 is_send(foo(Some(true)));
46 //~^ ERROR future cannot be sent between threads safely
47 is_send(foo2(Some(true)));
48 //~^ ERROR future cannot be sent between threads safely
49 is_send(foo3(Some(true)));
50 //~^ ERROR future cannot be sent between threads safely
51 is_send(foo4(Some(true)));
52 //~^ ERROR future cannot be sent between threads safely