about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-08-14 16:36:19 +0000
committerbors <bors@rust-lang.org>2014-08-14 16:36:19 +0000
commit404978ea722c0257cc763540c93243e8a21f82ed (patch)
treec6106879c326924dc3d39ce71c0a797901bafe04 /src/rustllvm/PassWrapper.cpp
parent56b86aaf35d96ec8cf8555205426eaed62427963 (diff)
parent8d272321417df3a954802e42a66adda87ade5a49 (diff)
downloadrust-404978ea722c0257cc763540c93243e8a21f82ed.tar.gz
rust-404978ea722c0257cc763540c93243e8a21f82ed.zip
auto merge of #16122 : pcwalton/rust/lifetimes-in-unboxed-closures, r=pnkfelix
This patch primarily does two things: (1) it prevents lifetimes from
leaking out of unboxed closures; (2) it allows unboxed closure type
notation, call notation, and construction notation to construct closures
matching any of the three traits.

This breaks code that looked like:

    let mut f;
    {
        let x = &5i;
        f = |&mut:| *x + 10;
    }

Change this code to avoid having a reference escape. For example:

    {
        let x = &5i;
        let mut f; // <-- move here to avoid dangling reference
        f = |&mut:| *x + 10;
    }

I believe this is enough to consider unboxed closures essentially
implemented. Further issues (for example, higher-rank lifetimes) should
be filed as followups.

Closes #14449.

[breaking-change]

r? @pnkfelix
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions