]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-64130-2-send.rs
Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrum
[rust.git] / src / test / ui / async-await / issue-64130-2-send.rs
1 #![feature(negative_impls)]
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 }