summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/issue-64130-4-async-move.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/async-await/issue-64130-4-async-move.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issue-64130-4-async-move.rs b/src/test/ui/async-await/issue-64130-4-async-move.rs
new file mode 100644
index 000000000..2538f3435
--- /dev/null
+++ b/src/test/ui/async-await/issue-64130-4-async-move.rs
@@ -0,0 +1,28 @@
+// edition:2018
+use std::any::Any;
+use std::future::Future;
+
+struct Client(Box<dyn Any + Send>);
+
+impl Client {
+ fn status(&self) -> u16 {
+ 200
+ }
+}
+
+async fn get() { }
+
+pub fn foo() -> impl Future + Send {
+ //~^ ERROR future cannot be sent between threads safely
+ let client = Client(Box::new(true));
+ async move {
+ match client.status() {
+ 200 => {
+ let _x = get().await;
+ },
+ _ => (),
+ }
+ }
+}
+
+fn main() {}