Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

async-await: [WIP] replace std await! macro with await syntax #1080

Closed
wants to merge 3 commits into from
Closed

async-await: [WIP] replace std await! macro with await syntax #1080

wants to merge 3 commits into from

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented May 9, 2019

Motivation

await syntax was implemented in rust-lang/rust#60586, and nightly-2019-05-09 has been released with the changes. Also, await! macro will be removed in the future.

Solution

await syntax only works in the 2018 edition, so this PR has not replaced some std await! macros yet (it needs to bump the minimum support version).

This PR currently uses a way that does not bump the minimum supported version, but this is blocked by std::r#await! macro not working (see rust-lang/rust#60660).

cc @carllerche @davidbarsky

`await` syntax was implemented in rust-lang/rust#60586, and
nightly-2019-05-09 has been released with the changes. Also, `await!`
macro will be removed in the future.
@taiki-e
Copy link
Member Author

taiki-e commented May 9, 2019

By the way, should we rename tokio::r#await! macro?

@davidbarsky
Copy link
Member

Thanks for opening this! We were thinking of having a compat! macro that does the into_awaitable dance in addition to a the replacement of the await! macro. Naming: I think we were gonna go with async_wait! or wait!—do you have any opinions?

@carllerche
Copy link
Member

I think we will have to remove tokio-futures from the main workspace and move it into a separate one (similar to the async-await dir) so that it can be switched to 2018.

@carllerche
Copy link
Member

Alternatively, we fork off 0.1 and leave it as is and start updating master...

@cramertj
Copy link
Contributor

cramertj commented May 9, 2019

I think we will have to remove tokio-futures from the main workspace and move it into a separate one (similar to the async-await dir) so that it can be switched to 2018.

Sorry if i'm skipping some detail here-- it should be possible to update only that one crate to 2018 without moving it to a separate workspace.

@taiki-e
Copy link
Member Author

taiki-e commented May 9, 2019

@cramertj

I think we will have to remove tokio-futures from the main workspace and move it into a separate one (similar to the async-await dir) so that it can be switched to 2018.

Sorry if i'm skipping some detail here-- it should be possible to update only that one crate to 2018 without moving it to a separate workspace.

It probably can only be done with Rust 1.31 or later. See also #935 (comment).

@carllerche
Copy link
Member

@cramertj maybe? I remember trying that initially, but hit problems...

Centril added a commit to Centril/rust that referenced this pull request May 9, 2019
…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
@taiki-e
Copy link
Member Author

taiki-e commented May 9, 2019

I added some commits. Hopefully, after #1082 is merged, just merge the master into this PR and CI will success.

@carllerche
Copy link
Member

Thanks for this ❤️ I pulled this PR into #1082, so I will close this.

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

Successfully merging this pull request may close these issues.

4 participants