about summary refs log tree commit diff
path: root/tests/ui/async-await/field-assign-nonsend.stderr
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-05-07 18:38:52 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-09-23 13:34:07 +0000
commita626caaad97b7f8733b8c9bd1fe9662cfc1e3ec1 (patch)
tree5dba1769b61e7fbf1be8ee5c1fa52878d85f30e7 /tests/ui/async-await/field-assign-nonsend.stderr
parentff032043653e7aebfbf74ab59572f929aa2beb65 (diff)
downloadrust-a626caaad97b7f8733b8c9bd1fe9662cfc1e3ec1.tar.gz
rust-a626caaad97b7f8733b8c9bd1fe9662cfc1e3ec1.zip
Revert duplication of tests.
Diffstat (limited to 'tests/ui/async-await/field-assign-nonsend.stderr')
-rw-r--r--tests/ui/async-await/field-assign-nonsend.stderr25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/async-await/field-assign-nonsend.stderr b/tests/ui/async-await/field-assign-nonsend.stderr
new file mode 100644
index 00000000000..481b236bbdb
--- /dev/null
+++ b/tests/ui/async-await/field-assign-nonsend.stderr
@@ -0,0 +1,25 @@
+error: future cannot be sent between threads safely
+  --> $DIR/field-assign-nonsend.rs:42:17
+   |
+LL |     assert_send(agent.handle());
+   |                 ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
+   |
+   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
+note: future is not `Send` as this value is used across an await
+  --> $DIR/field-assign-nonsend.rs:20:39
+   |
+LL |         let mut info = self.info_result.clone();
+   |             -------- has type `InfoResult` which is not `Send`
+...
+LL |         let _ = send_element(element).await;
+   |                                       ^^^^^ await occurs here, with `mut info` maybe used later
+LL |     }
+   |     - `mut info` is later dropped here
+note: required by a bound in `assert_send`
+  --> $DIR/field-assign-nonsend.rs:37:19
+   |
+LL | fn assert_send<T: Send>(_: T) {}
+   |                   ^^^^ required by this bound in `assert_send`
+
+error: aborting due to previous error
+