diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/async-await/in-trait/missing-send-bound.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/async-await/in-trait/missing-send-bound.rs b/tests/ui/async-await/in-trait/missing-send-bound.rs new file mode 100644 index 000000000..78922b59b --- /dev/null +++ b/tests/ui/async-await/in-trait/missing-send-bound.rs @@ -0,0 +1,21 @@ +// edition:2021 + +#![feature(async_fn_in_trait)] +//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes + +trait Foo { + async fn bar(); +} + +async fn test<T: Foo>() { + T::bar().await; +} + +fn test2<T: Foo>() { + assert_is_send(test::<T>()); + //~^ ERROR future cannot be sent between threads safely +} + +fn assert_is_send(_: impl Send) {} + +fn main() {} |