Skip to content

Implement built-in await syntax - #60586

Merged
bors merged 1 commit into
rust-lang:masterfrom
cramertj:await
May 8, 2019
Merged

Implement built-in await syntax#60586
bors merged 1 commit into
rust-lang:masterfrom
cramertj:await

Conversation

@cramertj

@cramertjcramertj commented May 6, 2019

Copy link
Copy Markdown
Member

Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for await as a non-keyword under the async_await
feature.

This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/

Fix#51719
Fix#51751
Fix#60016

@rust-highfive

Copy link
Copy Markdown
Contributor

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@highfive: run-doc-ui d5072b54ac4342f97688391fede9e2caff6b133a

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @oli-obk

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2019
@petrochenkovpetrochenkov self-assigned this May 6, 2019
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/mod.rs Outdated
Comment threadsrc/libsyntax/ast.rs Outdated
Comment threadsrc/libsyntax/ast.rs Outdated
Comment threadsrc/libsyntax/parse/parser.rs Outdated
Comment threadsrc/libsyntax/parse/token.rs Outdated
Comment threadsrc/librustc/hir/mod.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/test/ui/await-keyword/2015-edition-error-in-non-macro-position.rs Outdated
Comment threadsrc/test/ui/await-keyword/post_expansion_error.rs Outdated
Comment threadsrc/libsyntax/feature_gate.rs Outdated
Comment threadsrc/test/ui/issues/issue-51719.rs Outdated
Comment threadsrc/test/ui/issues/issue-51751.rs Outdated
Comment threadsrc/test/ui/feature-gate/await-macro.rs Outdated

@eddybeddyb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, modulo everyone else's comments.

@Centril

Copy link
Copy Markdown
Contributor

@bors p=50

This is a priority for the project and we want to facilitate writing of tests.

Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
Comment threadsrc/librustc/hir/lowering.rs Outdated
@oli-obk

oli-obk commented May 7, 2019 via email

Copy link
Copy Markdown
Contributor

@cramertj

Copy link
Copy Markdown
MemberAuthor

@oli-obk Okay, in that case I'd like to go ahead and land this without in order to land this soon and unblock testing.

@oli-obk

oli-obk commented May 7, 2019 via email

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Opened #60615

Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.
@cramertj

Copy link
Copy Markdown
MemberAuthor

@bors r=oli-obk

@bors

bors commented May 7, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit fe8760c has been approved by oli-obk

@borsbors 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 7, 2019
@bors

bors commented May 7, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit fe8760c with merge 33cde4a...

bors added a commit that referenced this pull request May 7, 2019
Implement built-in await syntax
Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.
This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/Fix#51719Fix#51751Fix#60016
@Centril

Copy link
Copy Markdown
Contributor

🎉 This is so exciting! 🎈

@bors

bors commented May 8, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 33cde4a to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label May 8, 2019
@bors
bors merged commit fe8760c into rust-lang:masterMay 8, 2019
@rust-highfive

Copy link
Copy Markdown
Contributor

📣 Toolstate changed by #60586!

Tested on commit 33cde4a.
Direct link to PR: #60586

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk@phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk@phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request May 8, 2019
Tested on commit rust-lang/rust@33cde4a.
Direct link to PR: <rust-lang/rust#60586>
💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk@phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk@phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request May 8, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request May 8, 2019
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 8, 2019
Changes:
````
rustup rust-lang#60586
Add test for rust-lang#771.
Clean up while_loop tests
````
bors added a commit that referenced this pull request May 8, 2019
submodules: update clippy from fc96aa0 to 341c96a
Fixes clippy toolstate
Fixes#60623
Changes:
````
rustup #60586
Add test for #771.
Clean up while_loop tests
````
r? @Manishearth
@petrochenkovpetrochenkov removed their assignment May 8, 2019
@KSXGitHub

Copy link
Copy Markdown

I just came from a Reddit post and I don't like postfix syntax at all. And it seems that the majority of Reddit don't like it either. I already commented on #50547 (comment) but I also write this comment to make my argument more visible.

I hope this syntax isn't final (i.e. You guys are willing to break postfix syntax for every nightly user in favor of a sane preference)

@Manishearth

Copy link
Copy Markdown
Member

@KSXGitHub

This is not the place to express disagreement with the language design choices made. Nor is the tracking issue: the language design team has made an explicit post on Discourse soliciting input.

If you plan to comment there, please bear in mind that the discussion has already played out quite a bit: make sure you have something substantial to say, and make sure it's not been said before in the thread.

@cramertj
cramertj deleted the await branch May 9, 2019 17:47
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
rustup rust-lang/rust#60586
Add test for rust-lang#771.
Clean up while_loop tests
````
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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.

Implement await syntax async/await errors should not discuss "yield statements" Prevent await from creating a generator

11 participants

@cramertj@rust-highfive@Centril@oli-obk@bors@KSXGitHub@Manishearth@eddyb@estebank@taiki-e@petrochenkov