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