]>
Commit | Line | Data |
---|---|---|
60c5eb7d | 1 | #![feature(optin_builtin_traits)] |
ba9703b0 | 2 | #![feature(negative_impls)] |
60c5eb7d XL |
3 | // edition:2018 |
4 | ||
5 | // This tests the the unspecialized async-await-specific error when futures don't implement an | |
6 | // auto trait (which is not Send or Sync) due to some type that was captured. | |
7 | ||
8 | auto trait Qux { } | |
9 | ||
10 | struct Foo; | |
11 | ||
12 | impl !Qux for Foo {} | |
13 | ||
14 | fn is_qux<T: Qux>(t: T) { } | |
15 | ||
16 | async fn bar() { | |
17 | let x = Foo; | |
18 | baz().await; | |
19 | } | |
20 | ||
21 | async fn baz() { } | |
22 | ||
23 | fn main() { | |
24 | is_qux(bar()); | |
25 | //~^ ERROR the trait bound `Foo: Qux` is not satisfied in `impl std::future::Future` | |
26 | } |