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

Conversation

@cramertj
Copy link
Member

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

This comment has been minimized.

Copy link
Collaborator

commented May 6, 2019

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@highfive: run-doc-ui d5072b5

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 6, 2019

r? @oli-obk

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

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 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/test/ui/await-keyword/2015-edition-error-in-non-macro-position.rs
Show resolved Hide resolved src/test/ui/await-keyword/post_expansion_error.rs
e.span,
"`await!(<expr>)` macro syntax is unstable, and will soon be removed \
in favor of `<expr>.await` syntax."
),

This comment has been minimized.

Copy link
@oli-obk

oli-obk May 7, 2019

Contributor

Not sure if it's worth the effort, but this could be a rustfixable suggestion

This comment has been minimized.

Copy link
@cramertj

cramertj May 7, 2019

Author Member

Leaving unresolved-- not going to worry about trying to make it correct to the point of automation right now-- seems like a fine thing to work on, but I'd like to land this Pr first.

This comment has been minimized.

Copy link
@estebank
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
@eddyb

eddyb approved these changes May 7, 2019

Copy link
Member

left a comment

LGTM, modulo everyone else's comments.

@Centril

This comment has been minimized.

Copy link
Member

commented May 7, 2019

@bors p=50

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

@cramertj cramertj force-pushed the cramertj:await branch from d5072b5 to d9f78b3 May 7, 2019

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 Outdated
@oli-obk

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

| ^^^^^^^^^^^^^^
= 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;
| ^^^^^^^^^^^

This comment has been minimized.

Copy link
@estebank

estebank May 7, 2019

Contributor

👀

This comment has been minimized.

Copy link
@cramertj

cramertj May 7, 2019

Author Member

Opened #60615

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.

@cramertj cramertj force-pushed the cramertj:await branch from d9f78b3 to fe8760c May 7, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

📌 Commit fe8760c has been approved by oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

⌛️ Testing commit fe8760c with merge 33cde4a...

bors added a commit that referenced this pull request May 7, 2019

Auto merge of #60586 - cramertj:await, r=oli-obk
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

This comment has been minimized.

Copy link
Member

commented May 7, 2019

🎉 This is so exciting! 🎈

@bors

This comment has been minimized.

Copy link
Contributor

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 label May 8, 2019

@bors bors merged commit fe8760c into rust-lang:master May 8, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 8, 2019

📣 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

📣 Toolstate changed by rust-lang/rust#60586!
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

submodules: update clippy from fc96aa03 to 341c96af
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

Auto merge of #60626 - matthiaskrgr:submodule_upd, r=Manishearth
submodules: update clippy from fc96aa03 to 341c96af

Fixes clippy toolstate

Fixes #60623

Changes:
````
rustup #60586
Add test for #771.
Clean up while_loop tests
````

r? @Manishearth

bors added a commit that referenced this pull request May 8, 2019

Auto merge of #60626 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from fc96aa03 to 341c96af

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

This comment has been minimized.

Copy link

commented May 9, 2019

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

This comment has been minimized.

Copy link
Member

commented May 9, 2019

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

taiki-e added a commit to taiki-e/tokio that referenced this pull request May 9, 2019

Replace std await! macro with await syntax
`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 added a commit to taiki-e/tokio that referenced this pull request May 9, 2019

Replace std await! macro with await syntax
`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 added a commit to taiki-e/tokio that referenced this pull request May 9, 2019

Replace std await! macro with await syntax
`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 added a commit to taiki-e/tokio that referenced this pull request May 9, 2019

async-await: replace std await! macro with await syntax
`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.

@cramertj cramertj deleted the cramertj:await branch May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.