]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/async-await/async-fn-nonsend.stderr
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / async-await / async-fn-nonsend.stderr
index bff282085735c8d8ba701253aed8b0c72df0c5f7..40ad46b48620d86454d6cb450d2cbd9d6d9cbfb2 100644 (file)
@@ -1,28 +1,5 @@
 error: future cannot be sent between threads safely
-  --> $DIR/async-fn-nonsend.rs:49:17
-   |
-LL |     assert_send(local_dropped_before_await());
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
-   |
-   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
-note: future is not `Send` as this value is used across an await
-  --> $DIR/async-fn-nonsend.rs:24:10
-   |
-LL |     let x = non_send();
-   |         - has type `impl Debug` which is not `Send`
-LL |     drop(x);
-LL |     fut().await;
-   |          ^^^^^^ await occurs here, with `x` maybe used later
-LL | }
-   | - `x` is later dropped here
-note: required by a bound in `assert_send`
-  --> $DIR/async-fn-nonsend.rs:46:24
-   |
-LL | fn assert_send(_: impl Send) {}
-   |                        ^^^^ required by this bound in `assert_send`
-
-error: future cannot be sent between threads safely
-  --> $DIR/async-fn-nonsend.rs:51:17
+  --> $DIR/async-fn-nonsend.rs:68:17
    |
 LL |     assert_send(non_send_temporary_in_match());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
@@ -32,41 +9,41 @@ note: future is not `Send` as this value is used across an await
   --> $DIR/async-fn-nonsend.rs:33:25
    |
 LL |     match Some(non_send()) {
-   |                ---------- has type `impl Debug` which is not `Send`
+   |           ---------------- has type `Option<impl Debug>` which is not `Send`
 LL |         Some(_) => fut().await,
-   |                         ^^^^^^ await occurs here, with `non_send()` maybe used later
+   |                         ^^^^^^ await occurs here, with `Some(non_send())` maybe used later
 ...
 LL | }
-   | - `non_send()` is later dropped here
+   | - `Some(non_send())` is later dropped here
 note: required by a bound in `assert_send`
-  --> $DIR/async-fn-nonsend.rs:46:24
+  --> $DIR/async-fn-nonsend.rs:64:24
    |
 LL | fn assert_send(_: impl Send) {}
    |                        ^^^^ required by this bound in `assert_send`
 
 error: future cannot be sent between threads safely
-  --> $DIR/async-fn-nonsend.rs:53:17
+  --> $DIR/async-fn-nonsend.rs:70:17
    |
 LL |     assert_send(non_sync_with_method_call());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
    |
    = help: the trait `Send` is not implemented for `dyn std::fmt::Write`
 note: future is not `Send` as this value is used across an await
-  --> $DIR/async-fn-nonsend.rs:42:14
+  --> $DIR/async-fn-nonsend.rs:46:14
    |
-LL |     let f: &mut std::fmt::Formatter = panic!();
-   |         - has type `&mut Formatter<'_>` which is not `Send`
-LL |     if non_sync().fmt(f).unwrap() == () {
+LL |     let f: &mut std::fmt::Formatter = &mut get_formatter();
+   |                                            --------------- has type `Formatter<'_>` which is not `Send`
+...
 LL |         fut().await;
-   |              ^^^^^^ await occurs here, with `f` maybe used later
+   |              ^^^^^^ await occurs here, with `get_formatter()` maybe used later
 LL |     }
 LL | }
-   | - `f` is later dropped here
+   | - `get_formatter()` is later dropped here
 note: required by a bound in `assert_send`
-  --> $DIR/async-fn-nonsend.rs:46:24
+  --> $DIR/async-fn-nonsend.rs:64:24
    |
 LL | fn assert_send(_: impl Send) {}
    |                        ^^^^ required by this bound in `assert_send`
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors