]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/in-trait/missing-send-bound.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / async-await / in-trait / missing-send-bound.rs
1 // edition:2021
2 // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3 // revisions: current next
4
5 #![feature(async_fn_in_trait)]
6 //~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
7
8 trait Foo {
9 async fn bar();
10 }
11
12 async fn test<T: Foo>() {
13 T::bar().await;
14 }
15
16 fn test2<T: Foo>() {
17 assert_is_send(test::<T>());
18 //~^ ERROR future cannot be sent between threads safely
19 }
20
21 fn assert_is_send(_: impl Send) {}
22
23 fn main() {}