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

Implement built-in await syntax #60586

Merged
merged 1 commit into from
May 8, 2019
Merged

Implement built-in await syntax #60586

merged 1 commit into from
May 8, 2019

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented May 6, 2019

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
Collaborator

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@highfive: run-doc-ui d5072b54ac4342f97688391fede9e2caff6b133a

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(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 6, 2019
@petrochenkov petrochenkov self-assigned this May 6, 2019
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Show resolved Hide resolved
src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/ast.rs Show resolved Hide resolved
src/libsyntax/ast.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/parser.rs Show resolved Hide resolved
src/libsyntax/parse/token.rs Outdated Show resolved Hide resolved
src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate.rs Show resolved Hide resolved
src/test/ui/issues/issue-51719.rs Outdated Show resolved Hide resolved
src/test/ui/issues/issue-51751.rs Outdated Show resolved Hide resolved
src/test/ui/feature-gate/await-macro.rs Outdated Show resolved Hide resolved
Copy link
Member

@eddyb eddyb left a comment

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
Contributor

Centril commented May 7, 2019

@bors p=50

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

src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
src/librustc/hir/lowering.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented May 7, 2019 via email

@cramertj
Copy link
Member Author

cramertj commented May 7, 2019

@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
Copy link
Contributor

oli-obk commented May 7, 2019 via email

| ^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
LL | bar().await;
| ^^^^^^^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Member Author

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
Member Author

cramertj commented May 7, 2019

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented May 7, 2019

📌 Commit fe8760c has been approved by oli-obk

@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 7, 2019
@bors
Copy link
Contributor

bors commented May 7, 2019

⌛ 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 #51719
Fix #51751
Fix #60016
@Centril
Copy link
Contributor

Centril commented May 7, 2019

🎉 This is so exciting! 🎈

@bors
Copy link
Contributor

bors commented May 8, 2019

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

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

📣 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
@petrochenkov petrochenkov removed their assignment May 8, 2019
@KSXGitHub
Copy link

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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet