about summary refs log tree commit diff
path: root/src/test/compile-fail/shadowed-lifetime.rs
AgeCommit message (Collapse)AuthorLines
2017-12-14Move compile-fail tests with NOTE/HELP annotations to UIVadim Petrochenkov-38/+0
2016-09-02Update E0496 to new formatAndrea Corradi-2/+4
2015-04-21Tests for shadowing between lifetimes and loop labels within function bodies.Felix S. Klock II-2/+2
2015-04-06Fix testsNiko Matsakis-9/+2
2015-02-18Update suffixes en masse in tests using `perl -p -i -e`Niko Matsakis-1/+1
2015-01-20Fix up some ‘help’ messagesP1start-4/+4
2015-01-08Update compile-fail tests to use is/us, not i/u.Huon Wilson-1/+1
2015-01-08Update compile fail tests to use isize.Huon Wilson-7/+7
2014-12-15Emit warning when lifetime names are shadowed.Niko Matsakis-0/+43
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 } } ``