]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #50854 - zackmdavis:and_the_case_of_the_unused_field_pattern_3_straig...
authorkennytm <kennytm@gmail.com>
Sat, 19 May 2018 15:41:03 +0000 (23:41 +0800)
committerkennytm <kennytm@gmail.com>
Sat, 19 May 2018 20:16:06 +0000 (04:16 +0800)
in which the unused shorthand field pattern debacle/saga continues

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


Trivial merge