rust/tests/ui/async-await/async-fn/suggest-constrain.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
257 B
Rust
Raw Normal View History

// 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() {}