rust/tests/ui/async-await/async-fn/suggest-constrain.rs
2025-02-25 20:02:01 +00:00

12 lines
257 B
Rust

// Ensure that we don't suggest constraining `CallRefFuture` here,
// since that isn't stable.
fn spawn<F: AsyncFn() + Send>(f: F) {
check_send(f());
//~^ ERROR cannot be sent between threads safely
}
fn check_send<T: Send>(_: T) {}
fn main() {}