]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/issue-64130-2-send.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / async-await / issue-64130-2-send.rs
1 #![feature(optin_builtin_traits)]
2 // edition:2018
3
4 // This tests the the specialized async-await-specific error when futures don't implement an
5 // auto trait (which is specifically Send) due to some type that was captured.
6
7 struct Foo;
8
9 impl !Send for Foo {}
10
11 fn is_send<T: Send>(t: T) { }
12
13 async fn bar() {
14 let x = Foo;
15 baz().await;
16 }
17
18 async fn baz() { }
19
20 fn main() {
21 is_send(bar());
22 //~^ ERROR future cannot be sent between threads safely
23 }