]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-64130-non-send-future-diags.stderr
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors
[rust.git] / tests / ui / async-await / issue-64130-non-send-future-diags.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-64130-non-send-future-diags.rs:23:13
3    |
4 LL |     is_send(foo());
5    |             ^^^^^ future returned by `foo` is not `Send`
6    |
7    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/issue-64130-non-send-future-diags.rs:17:10
10    |
11 LL |     let g = x.lock().unwrap();
12    |         - has type `MutexGuard<'_, u32>` which is not `Send`
13 LL |     baz().await;
14    |          ^^^^^^ await occurs here, with `g` maybe used later
15 LL | }
16    | - `g` is later dropped here
17 note: required by a bound in `is_send`
18   --> $DIR/issue-64130-non-send-future-diags.rs:9:15
19    |
20 LL | fn is_send<T: Send>(t: T) { }
21    |               ^^^^ required by this bound in `is_send`
22
23 error: aborting due to previous error
24