2 // revisions: drop-tracking no-drop-tracking
3 // [drop-tracking] compile-flags: -Zdrop-tracking=yes
4 // [no-drop-tracking] compile-flags: -Zdrop-tracking=no
8 async fn foo(x: Option<bool>) {
19 fn is_send<T: Send>(_: T) {}
21 async fn foo2(x: Option<bool>) {
22 let Some(_) = x else {
23 bar2(Rc::new(())).await
27 async fn bar2<T>(_: T) -> ! {
31 async fn foo3(x: Option<bool>) {
32 let Some(_) = x else {
33 (Rc::new(()), bar().await);
38 async fn foo4(x: Option<bool>) {
39 let Some(_) = x else {
48 is_send(foo(Some(true)));
49 //~^ ERROR cannot be sent between threads safely
50 is_send(foo2(Some(true)));
51 //~^ ERROR cannot be sent between threads safely
52 is_send(foo3(Some(true)));
53 //~^ ERROR cannot be sent between threads safely
54 is_send(foo4(Some(true)));
55 //~^ ERROR cannot be sent between threads safely