async move {
await!(wake_and_yield_once());
*x
- }
+ }
}
fn async_nonmove_block(x: u8) -> impl Future<Output = u8> {
async fn async_fn_with_named_lifetime_multiple_args<'a>(x: &'a u8, _y: &'a u8) -> u8 {
await!(wake_and_yield_once());
- *x
+ *x
}
fn async_fn_with_internal_borrow(y: u8) -> impl Future<Output = u8> {
macro_rules! test_with_borrow {
($($fn_name:expr,)*) => { $(
- test_future_yields_once_then_returns(|x| {
+ test_future_yields_once_then_returns(|x| {
async move {
await!($fn_name(&x))
}
async_closure,
async_fn,
async_fn_with_internal_borrow,
- |x| {
- async move {
- unsafe { await!(unsafe_async_fn(x)) }
- }
- },
+ |x| {
+ async move {
+ unsafe { await!(unsafe_async_fn(x)) }
+ }
+ },
}
test_with_borrow! {
async_fn_with_borrow,
async_fn_with_borrow_named_lifetime,
async_fn_with_impl_future_named_lifetime,
- |x| {
+ |x| {
async move {
await!(async_fn_with_named_lifetime_multiple_args(x, x))
}