about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-02-12 10:41:47 -0500
committerNiko Matsakis <niko@alum.mit.edu>2015-02-16 10:55:37 -0500
commitf58a1bfa981eee4ba4d4c3c801f94772e4ab0019 (patch)
tree9bbdee51ea1d846b8af6aa3549de7b76f2d69891 /src/rustllvm/RustWrapper.cpp
parent369adaf5150877c124de99a1b9a94f7b522aade6 (diff)
downloadrust-f58a1bfa981eee4ba4d4c3c801f94772e4ab0019.tar.gz
rust-f58a1bfa981eee4ba4d4c3c801f94772e4ab0019.zip
Fix fallout in libsyntax from RFC 599. Clarity and efficiency seems to be mostly improved, to my eye.
Nonetheless, as this commit demonstrates, the previous commits was a [breaking-change].

In practice, breakage is focused on functions of this form:

```rust
fn foo(..., object: Box<FnMut()>)
````

where `FnMut()` could be any trait object type. The older scheme defaulted objects in argument
position so that they were bounded by a fresh lifetime:

```rust
fn foo<'a>(..., object: Box<FnMut()+'a>)
```

This meant that the object could contain borrowed data. The newer
scheme defaults to a lifetime bound of `'static`:

```rust
fn foo(..., object: Box<FnMut()+'static>)
```

This means that the object cannot contain borrowed data. In some cases, the best fix
is to stop using `Box`:

```rust
fn foo(..., object: &mut FnMut())
```

but another option is to write an explicit annotation for the `'a`
lifetime that used to be implicit.  Both fixes are demonstrated in
this commit.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions