]> git.lizzy.rs Git - rust.git/commit
Auto merge of #7531 - Jarcho:manual_map_7413, r=camsteffen
authorbors <bors@rust-lang.org>
Mon, 16 Aug 2021 01:48:01 +0000 (01:48 +0000)
committerbors <bors@rust-lang.org>
Mon, 16 Aug 2021 01:48:01 +0000 (01:48 +0000)
commit3f0c97740f10372a6dc8a085eba571822911afc7
tree2dc77ba66f61affddca0f576cd743b097ab24fec
parentd4e2fcabb1cd69ecea19c6f8503ca86a34a183ec
parentf0444d73def161f7f0fda7b3f5a13e9908e9c550
Auto merge of #7531 - Jarcho:manual_map_7413, r=camsteffen

Manual map 7413

fixes: #7413

This only fixes the specific problem from #7413, not the general case. The full fix requires interacting with the borrow checker to determine the lifetime of all the borrows made in the function. I'll open an issue about it later.

changelog: Don't suggest using `map` when the option is borrowed in the match, and also consumed in the arm.
changelog: Locals declared within the would-be closure will not prevent the closure from being suggested in `manual_map` and `map_entry`