fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
967 B23 linesraw
1error[E0277]: `std::sync::MutexGuard<'_, u32>` cannot be sent between threads safely
2  --> $DIR/issue-64130-non-send-future-diags.rs:23:5
3   |
4LL | fn is_send<T: Send>(t: T) {
5   |    -------    ---- required by this bound in `is_send`
6...
7LL |     is_send(foo());
8   |     ^^^^^^^ `std::sync::MutexGuard<'_, u32>` cannot be sent between threads safely
9   |
10   = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, u32>`
11note: future does not implement `std::marker::Send` as this value is used across an await
12  --> $DIR/issue-64130-non-send-future-diags.rs:15:5
13   |
14LL |     let g = x.lock().unwrap();
15   |         - has type `std::sync::MutexGuard<'_, u32>`
16LL |     baz().await;
17   |     ^^^^^^^^^^^ await occurs here, with `g` maybe used later
18LL | }
19   | - `g` is later dropped here
20
21error: aborting due to previous error
22
23For more information about this error, try `rustc --explain E0277`.