]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-86507.rs
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
[rust.git] / tests / ui / async-await / issue-86507.rs
1 // edition:2018
2
3 use ::core::pin::Pin;
4 use ::core::future::Future;
5 use ::core::marker::Send;
6
7 trait Foo {
8     fn bar<'me, 'async_trait, T: Send>(x: &'me T)
9         -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
10         where 'me: 'async_trait;
11 }
12
13 impl Foo for () {
14     fn bar<'me, 'async_trait, T: Send>(x: &'me T)
15         -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
16         where 'me:'async_trait {
17             Box::pin( //~ ERROR future cannot be sent between threads safely
18                 async move {
19                     let x = x;
20                 }
21             )
22          }
23 }
24
25 fn main() { }