From 04fa9b1b3f947fa66bb3e92702e134c72af9486f Mon Sep 17 00:00:00 2001 From: David Wood Date: Wed, 25 Sep 2019 13:58:41 +0100 Subject: async/await: improve obligation errors This commit improves obligation errors for async/await: ``` note: future does not implement `std::marker::Send` because this value is used across an await --> $DIR/issue-64130-non-send-future-diags.rs:15:5 | LL | let g = x.lock().unwrap(); | - has type `std::sync::MutexGuard<'_, u32>` LL | baz().await; | ^^^^^^^^^^^ await occurs here, with `g` maybe used later LL | } | - `g` is later dropped here ``` Signed-off-by: David Wood --- src/libstd/future.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstd') diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 0406549ff07..c65f71fb1a4 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -26,6 +26,7 @@ pub fn from_generator>(x: T) -> impl Future>(T); // We rely on the fact that async/await futures are immovable in order to create -- cgit 1.4.1-3-g733a5