diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-12-12 11:09:24 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-12-15 10:23:48 -0500 |
| commit | b60de4bfc2cf45ebe16b9b5b768f0aad54211625 (patch) | |
| tree | 5fcc550e359758bb9737a905ac91b685b165e6a4 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | ef0bc464af110d24d4663fbe51eca3646a897308 (diff) | |
| download | rust-b60de4bfc2cf45ebe16b9b5b768f0aad54211625.tar.gz rust-b60de4bfc2cf45ebe16b9b5b768f0aad54211625.zip | |
Emit warning when lifetime names are shadowed.
This is not technically a [breaking-change], but it will be soon, so
you should update your code. Typically, shadowing is accidental, and
the shadowing lifetime can simply be removed. This frequently occurs
in constructor patterns:
```rust
// Old:
impl<'a> SomeStruct<'a> { fn new<'a>(..) -> SomeStruct<'a> { ... } }
// Should be:
impl<'a> SomeStruct<'a> { fn new(..) -> SomeStruct<'a> { ... } }
```
Otherwise, you should rename the inner lifetime to something
else. Note though that lifetime elision frequently applies:
```rust
// Old
impl<'a> SomeStruct<'a> {
fn get<'a>(x: &'a self) -> &'a T { &self.field }
}
// Should be:
impl<'a> SomeStruct<'a> {
fn get(x: &self) -> &T { &self.field }
}
``
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
