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

Fix async desugaring providing wrong input to procedural macros. #60676

Merged
merged 3 commits into from May 10, 2019

Conversation

Projects
None yet
5 participants
@davidtwco
Copy link
Member

commented May 9, 2019

Fixes #60674.

This PR fixes a minor oversight introduced by #60535 where unused mut binding modes were removed from the arguments to an async fn (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the unused_mut error that it avoided.

r? @cramertj
cc @taiki-e

davidtwco added some commits May 9, 2019

Add regression test for #60674.
This commit adds a regression test (with current broken behaviour) that
tests that `mut` patterns are not lost when provided as input to a proc macro.
Do not modify mutability of simple bindings.
This commit removes the modification of the mutability of simple
bindings. While the mutability isn't used, it is important that it is
kept so that the input to procedural macros matches what the user wrote.
This commit also modifies the span of the binding mode so that it is
considered a compiler desugaring and won't be linted against for being
unused..
Add FIXME about `construct_async_arguments`.
This is unrelated to the rest of this PR but it made sense to add a
FIXME explaining that the function shouldn't really be in the parser.
@cramertj

This comment has been minimized.

Copy link
Member

commented May 9, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

📌 Commit d5e0406 has been approved by cramertj

Centril added a commit to Centril/rust that referenced this pull request May 9, 2019

Rollup merge of rust-lang#60676 - davidtwco:issue-60674, r=cramertj
Fix async desugaring providing wrong input to procedural macros.

Fixes rust-lang#60674.

This PR fixes a minor oversight introduced by rust-lang#60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided.

r? @cramertj
cc @taiki-e

@Centril Centril referenced this pull request May 9, 2019

Merged

Rollup of 8 pull requests #60683

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

Auto merge of #60683 - Centril:rollup-p05qh5d, r=Centril
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 d5e0406 into rust-lang:master May 10, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details
@bors

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

⌛️ Testing commit d5e0406 with merge 03bd2f6...

@davidtwco davidtwco deleted the davidtwco:issue-60674 branch May 10, 2019

davidtwco added a commit to davidtwco/rust that referenced this pull request May 10, 2019

Extend existing test for nested mut patterns.
At request of `@Centril`, this commit extends the existing test added
by rust-lang#60676 to include nested `mut` patterns.

Centril added a commit to Centril/rust that referenced this pull request May 10, 2019

Rollup merge of rust-lang#60692 - davidtwco:pr-60676-followup, r=Centril
Extend rust-lang#60676 test for nested mut patterns.

At request of @Centril, this commit extends the existing test added by rust-lang#60676 to include nested `mut` patterns.

cc @Centril

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

Auto merge of #60708 - Centril:rollup-j5smdo0, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #60529 (RFC 2008: Uninhabitedness fixes for enum variants and tests)
 - #60620 (Fix a couple of FIXMEs in ext::tt::transcribe)
 - #60659 (Tweak `Symbol` and `InternedString`)
 - #60692 (Extend #60676 test for nested mut patterns.)
 - #60697 (add regression test for #60629)
 - #60701 (Update mailmap for mati865)

Failed merges:

r? @ghost

@taiki-e taiki-e referenced this pull request May 16, 2019

Merged

Remove #[allow(unused_mut)] #231

1 of 8 tasks complete
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.