blob: 3dd9249a791875caf214bdfcb546e3ff6bbb5c80 [file] [log] [blame]
// revisions: with without
// edition: 2021
// [with] check-pass
#![feature(return_type_notation, async_fn_in_trait)]
//~^ WARN the feature `return_type_notation` is incomplete
trait Foo {
async fn method() -> Result<(), ()>;
}
async fn foo<T: Foo>() -> Result<(), ()> {
T::method().await?;
Ok(())
}
fn is_send(_: impl Send) {}
fn test<
#[cfg(with)] T: Foo<method(): Send>,
#[cfg(without)] T: Foo,
>() {
is_send(foo::<T>());
//[without]~^ ERROR future cannot be sent between threads safely
}
fn main() {}