2 #![feature(must_not_suspend)]
3 #![allow(must_not_suspend)]
5 use std::future::Future;
8 fn fake_spawn<F: Future + Send + 'static>(f: F) { }
10 async fn wrong_mutex() {
11 let m = Mutex::new(1);
13 let mut guard = m.lock().unwrap();
14 (async { "right"; }).await;
18 (async { "wrong"; }).await;
22 fake_spawn(wrong_mutex()); //~ Error future cannot be sent between threads safely