From: bors Date: Fri, 22 Jun 2018 06:36:11 +0000 (+0000) Subject: Auto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug... X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=7dae5c0e06f10042fc3b29a55bf6285e539c06db;p=rust.git Auto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug, r=eddyb yet another "old borrowck" bug around match default bindings We were getting the type of the parameter from its pattern, but that didn't include adjustments. I did a `ripgrep` around and this seemed to be the only affected case. The reason this didn't show up as an ICE earlier is that mem-categorization is lenient with respect to weird discrepancies. I am going to add more delay-span-bug calls shortly around that (I'll push onto the PR). This example is an ICE, but I presume that there is a way to make a soundness example out of this -- it basically ignores borrows occuring inside match-default-bindings in a closure, though only if the implicit deref is at the top-level. It happens though that this occurs frequently in iterators, which often give a `&T` parameter. Fixes #51415 Fixes #49534 r? @eddyb --- 7dae5c0e06f10042fc3b29a55bf6285e539c06db