Import async-trait crate.
Bug: 164106399
Bug: 158290206
Test: mm
Change-Id: I0c4a491b785134e4ac1d5572e5ff94b8699dc0bc
diff --git a/tests/ui/send-not-implemented.stderr b/tests/ui/send-not-implemented.stderr
new file mode 100644
index 0000000..2f288f5
--- /dev/null
+++ b/tests/ui/send-not-implemented.stderr
@@ -0,0 +1,22 @@
+error: future cannot be sent between threads safely
+ --> $DIR/send-not-implemented.rs:8:26
+ |
+8 | async fn test(&self) {
+ | __________________________^
+9 | | let mutex = Mutex::new(());
+10 | | let _guard = mutex.lock().unwrap();
+11 | | f().await;
+12 | | }
+ | |_____^ future returned by `__test` is not `Send`
+ |
+ = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>`
+note: future is not `Send` as this value is used across an await
+ --> $DIR/send-not-implemented.rs:11:9
+ |
+10 | let _guard = mutex.lock().unwrap();
+ | ------ has type `std::sync::MutexGuard<'_, ()>` which is not `Send`
+11 | f().await;
+ | ^^^^^^^^^ await occurs here, with `_guard` maybe used later
+12 | }
+ | - `_guard` is later dropped here
+ = note: required for the cast to the object type `dyn std::future::Future<Output = ()> + std::marker::Send`