fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.5 KiB34 linesraw
1error[E0277]: the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
2  --> $DIR/async-is-unwindsafe.rs:12:5
3   |
4LL |       is_unwindsafe(async {
5   |  _____^^^^^^^^^^^^^_-
6   | |     |
7   | |     `&mut Context<'_>` may not be safely transferred across an unwind boundary
8LL | |
9LL | |         use std::ptr::null;
10LL | |         use std::task::{Context, RawWaker, RawWakerVTable, Waker};
11...  |
12LL | |         drop(cx_ref);
13LL | |     });
14   | |_____- within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`
15   |
16   = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
17   = note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>`
18note: future does not implement `UnwindSafe` as this value is used across an await
19  --> $DIR/async-is-unwindsafe.rs:25:18
20   |
21LL |         let cx_ref = &mut cx;
22   |             ------ has type `&mut Context<'_>` which does not implement `UnwindSafe`
23LL |
24LL |         async {}.await; // this needs an inner await point
25   |                  ^^^^^ await occurs here, with `cx_ref` maybe used later
26note: required by a bound in `is_unwindsafe`
27  --> $DIR/async-is-unwindsafe.rs:3:26
28   |
29LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
30   |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
31
32error: aborting due to previous error
33
34For more information about this error, try `rustc --explain E0277`.