]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/in-trait/missing-send-bound.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.git] / tests / ui / async-await / in-trait / missing-send-bound.rs
1 // edition:2021
2
3 #![feature(async_fn_in_trait)]
4 //~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
5
6 trait Foo {
7     async fn bar();
8 }
9
10 async fn test<T: Foo>() {
11     T::bar().await;
12 }
13
14 fn test2<T: Foo>() {
15     assert_is_send(test::<T>());
16     //~^ ERROR future cannot be sent between threads safely
17 }
18
19 fn assert_is_send(_: impl Send) {}
20
21 fn main() {}