Skip to content

Commit

Permalink
Rollup merge of rust-lang#60675 - cramertj:no-await-macro, r=nikomats…
Browse files Browse the repository at this point in the history
…akis,Centril

Remove the old await! macro

This doesn't work anymore, and its continued presence is cause for confusion. `yield` can no longer be used to return `Pending` from an `async` body.

cc rust-lang#60660
cc @taiki-e
cc tokio-rs/tokio#1080
  • Loading branch information
Centril committed May 9, 2019
2 parents f27f14b + df41e4f commit f6df1f6
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,29 +357,6 @@ macro_rules! dbg {
};
}

/// Awaits the completion of an async call.
#[macro_export]
#[unstable(feature = "await_macro", issue = "50547")]
#[allow_internal_unstable(gen_future, generators)]
#[allow_internal_unsafe]
macro_rules! r#await {
($e:expr) => { {
let mut pinned = $e;
loop {
if let $crate::task::Poll::Ready(x) =
$crate::future::poll_with_tls_context(unsafe {
$crate::pin::Pin::new_unchecked(&mut pinned)
})
{
break x;
}
// FIXME(cramertj) prior to stabilizing await, we have to ensure that this
// can't be used to create a generator on stable via `|| await!()`.
yield
}
} }
}

/// Selects the first successful receive event from a number of receivers.
///
/// This macro is used to wait for the first event to occur on a number of
Expand Down

0 comments on commit f6df1f6

Please sign in to comment.