]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-64130-3-other.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.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 }
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 Future<Output = ()>`
26 }