]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-67252-unnamed-future.rs
Rollup merge of #107108 - sulami:issue-83968-doc-alias-typo-suggestions, r=compiler...
[rust.git] / tests / ui / async-await / issue-67252-unnamed-future.rs
1 // edition:2018
2 use std::future::Future;
3 use std::pin::Pin;
4 use std::task::{Context, Poll};
5
6 fn spawn<T: Send>(_: T) {}
7
8 pub struct AFuture;
9 impl Future for AFuture{
10     type Output = ();
11
12     fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<()> {
13         unimplemented!()
14     }
15 }
16
17 async fn foo() {
18     spawn(async { //~ ERROR future cannot be sent between threads safely
19         let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
20         AFuture.await;
21     });
22 }
23
24 fn main() {}