]>
Commit | Line | Data |
---|---|---|
ba9703b0 | 1 | #![feature(negative_impls)] |
60c5eb7d XL |
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 | } |