From: bors Date: Thu, 18 Oct 2018 18:14:52 +0000 (+0000) Subject: Auto merge of #54976 - davidtwco:issue-52663-special-case-closures, r=nikomatsakis X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e7f5d48059aa14cc2808473564deadd72d1e818d;p=rust.git Auto merge of #54976 - davidtwco:issue-52663-special-case-closures, r=nikomatsakis NLL lacks various special case handling of closures Part of #52663. Firstly, this PR extends existing handling of closures to also support generators. Second, this PR adds the note found in the AST when a closure is invoked twice and captures a variable by-value: ```text note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment --> $DIR/issue-42065.rs:16:29 | LL | for (key, value) in dict { | ^^^^ ``` r? @nikomatsakis cc @pnkfelix --- e7f5d48059aa14cc2808473564deadd72d1e818d