about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-15 14:16:54 -0700
committerbors <bors@rust-lang.org>2014-04-15 14:16:54 -0700
commit10f94e3fe5859fe7fc001cf26f4fa401d9a2ee2e (patch)
treedfec604a3889f58957e732a3b36fafdce711af55 /src/rustllvm/RustWrapper.cpp
parent189584e792bfc10142793ca1117e803c2201991a (diff)
parent79d1e5df2190e4cfdd1814af95837b21ef046745 (diff)
downloadrust-10f94e3fe5859fe7fc001cf26f4fa401d9a2ee2e.tar.gz
rust-10f94e3fe5859fe7fc001cf26f4fa401d9a2ee2e.zip
auto merge of #13164 : ktt3ja/rust/lifetime-suggestion-method, r=nmatsakis
This includes a change to the way lifetime names are generated. Say we
figure that `[#0, 'a, 'b]` have to be the same lifetimes, then instead
of just generating a new lifetime `'c` like before to replace them, we
would reuse `'a`. This is done so that when the lifetime name comes
from an impl, we don't give something that's completely off, and we
don't have to do much work to figure out where the name came from. For
example, for the following code snippet:

```rust
struct Baz<'x> {
    bar: &'x int
}

impl<'x> Baz<'x> {
    fn baz1(&self) -> &int {
        self.bar
    }
}
```

`[#1, 'x]` (where `#1` is BrAnon(1) and refers to lifetime of `&int`)
have to be marked the same lifetime. With the old method, we would
generate a new lifetime `'a` and suggest `fn baz1(&self) -> &'a int`
or `fn baz1<'a>(&self) -> &'a int`, both of which are wrong.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions