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

in which the unused shorthand field pattern debacle/saga continues #50854

Conversation

zackmdavis
Copy link
Member

In e4b1a79 (#47922), we corrected erroneous suggestions for unused
shorthand field pattern bindings, suggesting field: _ where the
previous suggestion of _field wouldn't even have compiled
(#47390). Soon, it was revealed that this was insufficient (#50303), and
the fix was extended to references, slices, &c. (#50327) But even this
proved inadequate, as the erroneous suggestions were still being issued
for patterns in local (let) bindings (#50804). Here, we yank the
shorthand-detection and variable/node registration code into a new
common function that can be called while visiting both match arms and
let bindings.

Resolves #50804.

r? @estebank

In e4b1a79 (rust-lang#47922), we corrected erroneous suggestions for unused
shorthand field pattern bindings, suggesting `field: _` where the
previous suggestion of `_field` wouldn't even have compiled
(rust-lang#47390). Soon, it was revealed that this was insufficient (rust-lang#50303), and
the fix was extended to references, slices, &c. (rust-lang#50327) But even this
proved inadequate, as the erroneous suggestions were still being issued
for patterns in local (`let`) bindings (rust-lang#50804). Here, we yank the
shorthand-detection and variable/node registration code into a new
common function that can be called while visiting both match arms and
`let` bindings.

Resolves rust-lang#50804.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 18, 2018
@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 18, 2018

📌 Commit 59782f4 has been approved by estebank

@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 18, 2018
kennytm added a commit to kennytm/rust that referenced this pull request May 19, 2018
…ed_field_pattern_3_straight_to_video, r=estebank

in which the unused shorthand field pattern debacle/saga continues

In e4b1a79 (rust-lang#47922), we corrected erroneous suggestions for unused
shorthand field pattern bindings, suggesting `field: _` where the
previous suggestion of `_field` wouldn't even have compiled
(rust-lang#47390). Soon, it was revealed that this was insufficient (rust-lang#50303), and
the fix was extended to references, slices, &c. (rust-lang#50327) But even this
proved inadequate, as the erroneous suggestions were still being issued
for patterns in local (`let`) bindings (rust-lang#50804). Here, we yank the
shorthand-detection and variable/node registration code into a new
common function that can be called while visiting both match arms and
`let` bindings.

Resolves rust-lang#50804.

r? @estebank
bors added a commit that referenced this pull request May 19, 2018
Rollup of 8 pull requests

Successful merges:

 - #50531 (Cleanup uses of TypeIdHasher and replace them with StableHasher)
 - #50819 (Fix potential divide by zero)
 - #50827 (Update LLVM to 56c931901cfb85cd6f7ed44c7d7520a8de1edf97)
 - #50829 (CheckLoopVisitor: also visit break expressions)
 - #50854 (in which the unused shorthand field pattern debacle/saga continues)
 - #50858 (Reorder description for snippets in rustdoc documentation)
 - #50883 (Fix warning when building stage0 libcore)
 - #50889 (Update clippy)

Failed merges:
@bors bors merged commit 59782f4 into rust-lang:master May 20, 2018
@zackmdavis zackmdavis deleted the and_the_case_of_the_unused_field_pattern_3_straight_to_video branch May 23, 2018 01:45
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.

Bad help suggestion in unused variable warning
4 participants