diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-07-29 22:08:39 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-08-14 08:53:25 -0700 |
| commit | 8d272321417df3a954802e42a66adda87ade5a49 (patch) | |
| tree | bb73f130dbe32e8a4714319e5c793702a02a53e1 /src/rustllvm/PassWrapper.cpp | |
| parent | 9d45d63d0d18f21f74c8a2a4e5367a785932f64e (diff) | |
| download | rust-8d272321417df3a954802e42a66adda87ade5a49.tar.gz rust-8d272321417df3a954802e42a66adda87ade5a49.zip | |
librustc: Tie up loose ends in unboxed closures.
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]
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
