summaryrefslogtreecommitdiffstats
path: root/library/core/src/future
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/future')
-rw-r--r--library/core/src/future/into_future.rs1
-rw-r--r--library/core/src/future/join.rs6
-rw-r--r--library/core/src/future/mod.rs8
3 files changed, 4 insertions, 11 deletions
diff --git a/library/core/src/future/into_future.rs b/library/core/src/future/into_future.rs
index 649b43387..38c654e76 100644
--- a/library/core/src/future/into_future.rs
+++ b/library/core/src/future/into_future.rs
@@ -99,6 +99,7 @@ use crate::future::Future;
/// }
/// ```
#[stable(feature = "into_future", since = "1.64.0")]
+#[rustc_diagnostic_item = "IntoFuture"]
pub trait IntoFuture {
/// The output that the future will produce on completion.
#[stable(feature = "into_future", since = "1.64.0")]
diff --git a/library/core/src/future/join.rs b/library/core/src/future/join.rs
index 35f0dea06..3f35179dd 100644
--- a/library/core/src/future/join.rs
+++ b/library/core/src/future/join.rs
@@ -4,7 +4,7 @@ use crate::cell::UnsafeCell;
use crate::future::{poll_fn, Future};
use crate::mem;
use crate::pin::Pin;
-use crate::task::{Context, Poll};
+use crate::task::{ready, Context, Poll};
/// Polls multiple futures simultaneously, returning a tuple
/// of all results once complete.
@@ -118,7 +118,7 @@ macro join_internal {
fut
})
};
- // Despite how tempting it may be to `let () = fut.poll(cx).ready()?;`
+ // Despite how tempting it may be to `let () = ready!(fut.poll(cx));`
// doing so would defeat the point of `join!`: to start polling eagerly all
// of the futures, to allow parallelizing the waits.
done &= fut.poll(cx).is_ready();
@@ -180,7 +180,7 @@ impl<F: Future> Future for MaybeDone<F> {
// Do not mix match ergonomics with unsafe.
match *self.as_mut().get_unchecked_mut() {
MaybeDone::Future(ref mut f) => {
- let val = Pin::new_unchecked(f).poll(cx).ready()?;
+ let val = ready!(Pin::new_unchecked(f).poll(cx));
self.set(Self::Done(val));
}
MaybeDone::Done(_) => {}
diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs
index 04f02d47f..089493d37 100644
--- a/library/core/src/future/mod.rs
+++ b/library/core/src/future/mod.rs
@@ -66,11 +66,3 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
// that fulfills all the requirements for a mutable reference.
unsafe { &mut *cx.0.as_ptr().cast() }
}
-
-#[doc(hidden)]
-#[unstable(feature = "gen_future", issue = "50547")]
-#[inline]
-#[cfg_attr(bootstrap, lang = "identity_future")]
-pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut {
- f
-}