Skip to content

Some functions in future module to no_std #696

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

k-nasa
Copy link
Member

@k-nasa k-nasa commented Feb 4, 2020

Some functions in future module to no_std

@k-nasa k-nasa force-pushed the to_no_std_future_module branch from a7eaa87 to 3883079 Compare February 4, 2020 10:05
@k-nasa k-nasa marked this pull request as ready for review February 4, 2020 10:06
@k-nasa k-nasa assigned k-nasa and unassigned k-nasa Feb 5, 2020
@k-nasa k-nasa requested a review from yoshuawuyts March 3, 2020 14:20
@@ -23,15 +23,18 @@ use crate::task::{Context, Poll};
/// #
/// # })
/// ```
pub async fn poll_fn<F, T>(f: F) -> T
pub fn poll_fn<F, T>(f: F) -> PollFn<F>
Copy link
Contributor

@yoshuawuyts yoshuawuyts Mar 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm so-so about this change. Functions such as io::copy don't work on no-std either, but would be really useful to have as well. Having these functions be async fn was a bit of a deliberate choice when designing async-std.

With async await for embedded rust steadily progressing, I wonder how needed this is. It seems as async/await continues to move beyond mvp status this will be much of a non-issue.

All in all I think it'd be okay to leave these methods as-is for now. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, the feature won't make the cut in 6 days, so it's at least 18 weeks out. Given that this is no user-visible change, I'd be fine with enabling embrio users to use this currently.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the interface seen from the user does not change, I think that it is OK to change this.


pub(crate) mod future;
mod ready;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe ready should be able to work in no-std.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants