]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/issue-64130-3-other.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / async-await / issue-64130-3-other.rs
1 #![feature(auto_traits)]
2 #![feature(negative_impls)]
3 // edition:2018
4
5 // This tests 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 drop(x);
20 }
21
22 async fn baz() {}
23
24 fn main() {
25 is_qux(bar());
26 //~^ ERROR the trait bound `Foo: Qux` is not satisfied in `impl Future<Output = ()>`
27 }