fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
2.5 KiB66 linesraw
1error: future cannot be sent between threads safely
2  --> $DIR/async-fn-nonsend.rs:49:5
3   |
4LL | fn assert_send(_: impl Send) {}
5   |    -----------         ---- required by this bound in `assert_send`
6...
7LL |     assert_send(local_dropped_before_await());
8   |     ^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
9   |
10   = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
11note: future is not `Send` as this value is used across an await
12  --> $DIR/async-fn-nonsend.rs:24:5
13   |
14LL |     let x = non_send();
15   |         - has type `impl std::fmt::Debug`
16LL |     drop(x);
17LL |     fut().await;
18   |     ^^^^^^^^^^^ await occurs here, with `x` maybe used later
19LL | }
20   | - `x` is later dropped here
21
22error: future cannot be sent between threads safely
23  --> $DIR/async-fn-nonsend.rs:51:5
24   |
25LL | fn assert_send(_: impl Send) {}
26   |    -----------         ---- required by this bound in `assert_send`
27...
28LL |     assert_send(non_send_temporary_in_match());
29   |     ^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
30   |
31   = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
32note: future is not `Send` as this value is used across an await
33  --> $DIR/async-fn-nonsend.rs:33:20
34   |
35LL |     match Some(non_send()) {
36   |                ---------- has type `impl std::fmt::Debug`
37LL |         Some(_) => fut().await,
38   |                    ^^^^^^^^^^^ await occurs here, with `non_send()` maybe used later
39...
40LL | }
41   | - `non_send()` is later dropped here
42
43error: future cannot be sent between threads safely
44  --> $DIR/async-fn-nonsend.rs:53:5
45   |
46LL | fn assert_send(_: impl Send) {}
47   |    -----------         ---- required by this bound in `assert_send`
48...
49LL |     assert_send(non_sync_with_method_call());
50   |     ^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
51   |
52   = help: the trait `std::marker::Send` is not implemented for `dyn std::fmt::Write`
53note: future is not `Send` as this value is used across an await
54  --> $DIR/async-fn-nonsend.rs:42:9
55   |
56LL |     let f: &mut std::fmt::Formatter = panic!();
57   |         - has type `&mut std::fmt::Formatter<'_>`
58LL |     if non_sync().fmt(f).unwrap() == () {
59LL |         fut().await;
60   |         ^^^^^^^^^^^ await occurs here, with `f` maybe used later
61LL |     }
62LL | }
63   | - `f` is later dropped here
64
65error: aborting due to 3 previous errors
66