diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index cdde094147012..ee547667c349d 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -27,7 +27,7 @@ pub use pending::{pending, Pending}; pub use ready::{ready, Ready}; #[unstable(feature = "future_poll_fn", issue = "72302")] -pub use poll_fn::{poll_fn, PollFn}; +pub use poll_fn::poll_fn; /// This type is needed because: /// diff --git a/library/core/src/future/poll_fn.rs b/library/core/src/future/poll_fn.rs index af63e1bb097b8..7564fd3febc86 100644 --- a/library/core/src/future/poll_fn.rs +++ b/library/core/src/future/poll_fn.rs @@ -24,7 +24,7 @@ use crate::task::{Context, Poll}; /// # } /// ``` #[unstable(feature = "future_poll_fn", issue = "72302")] -pub fn poll_fn(f: F) -> PollFn +pub fn poll_fn(f: F) -> impl Future where F: FnMut(&mut Context<'_>) -> Poll, { @@ -37,7 +37,7 @@ where /// documentation for more. #[must_use = "futures do nothing unless you `.await` or poll them"] #[unstable(feature = "future_poll_fn", issue = "72302")] -pub struct PollFn { +struct PollFn { f: F, }