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

Remove the old await! macro #60675

Merged
merged 1 commit into from
May 10, 2019
Merged

Remove the old await! macro #60675

merged 1 commit into from
May 10, 2019

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented May 9, 2019

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 #60660
cc @taiki-e
cc tokio-rs/tokio#1080

This doesn't work anymore, and its continued
presence is cause for confusion.
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2019
@taiki-e
Copy link
Member

taiki-e commented May 9, 2019

Hmm... I thought that we could fix this by changing std::r#await! macro as follows and the compiler ignores await! macro (and maybe adjust the feature gate).

macro_rules! r#await {
    ($e:expr) => { 
        $e.await
    }
}

However, if it is difficult, I think this PR is fine.

@nikomatsakis
Copy link
Contributor

I was also assuming that we would change await! to just be foo.await -- at least for now. I guess there is a good question of when to remove support "for good".

@cramertj
Copy link
Member Author

cramertj commented May 9, 2019

@taiki-e Unfortunately that doesn't work because we ban yield in async bodies, so the yield inside the await! macro won't work.

@cramertj
Copy link
Member Author

cramertj commented May 9, 2019

@nikomatsakis I think that'd still be confusing since await!(...) doesn't call the std macro anymore.

@taiki-e
Copy link
Member

taiki-e commented May 9, 2019

@cramertj

@taiki-e Unfortunately that doesn't work because we ban yield in async bodies, so the yield inside the await! macro won't work.

The current await! macro doesn't work because it uses yield internally. My suggestion is to use the await syntax instead of them. I think it works because it is almost the same as a macro such as futures::pending.

@nikomatsakis
Copy link
Contributor

@cramertj oh, I didn't realize that. Never mind, then.

@cramertj
Copy link
Member Author

cramertj commented May 9, 2019

@taiki-e yeah, we could do that, but people could also do that in an external library, and as I mentioned to @nikomatsakis, I think it runs the risk of being more confusing than helpful.

@taiki-e
Copy link
Member

taiki-e commented May 9, 2019

@taiki-e yeah, we could do that, but people could also do that in an external library, and as I mentioned to @nikomatsakis, I think it runs the risk of being more confusing than helpful.

Oh, that makes sense.

@Centril
Copy link
Contributor

Centril commented May 9, 2019

@bors r=nikomatsakis,Centril

@bors
Copy link
Contributor

bors commented May 9, 2019

📌 Commit df41e4f has been approved by nikomatsakis,Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2019
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
bors added a commit that referenced this pull request May 10, 2019
Rollup of 8 pull requests

Successful merges:

 - #59348 (Clean up and add tests for slice drop shims)
 - #60188 (Identify when a stmt could have been parsed as an expr)
 - #60234 (std: Derive `Default` for `io::Cursor`)
 - #60618 (Comment ext::tt::transcribe)
 - #60648 (Skip codegen for one UI test with long file path)
 - #60671 (remove unneeded `extern crate`s from build tools)
 - #60675 (Remove the old await! macro)
 - #60676 (Fix async desugaring providing wrong input to procedural macros.)

Failed merges:

r? @ghost
@bors bors merged commit df41e4f into rust-lang:master May 10, 2019
@cramertj cramertj deleted the no-await-macro branch May 10, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants