]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/issues/issue-64477.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / async-await / issues / issue-64477.rs
CommitLineData
e1599b0c
XL
1// Regression test for #64477.
2//
3// We were incorrectly claiming that the `f(x).await` future captured
4// a value of type `T`, and hence that `T: Send` would have to hold.
5//
6// check-pass
7// edition:2018
8
9use std::future::Future;
10use std::pin::Pin;
11
12fn f<T>(_: &T) -> Pin<Box<dyn Future<Output = ()> + Send>> {
13 unimplemented!()
14}
15
16pub fn g<T: Sync>(x: &'static T) -> impl Future<Output = ()> + Send {
17 async move { f(x).await }
18}
19
20fn main() { }