about summary refs log tree commit diff
path: root/src/test/ui/lifetimes
AgeCommit message (Collapse)AuthorLines
2018-07-23Match errors using the callsite of macro expansionsFederico Poli-1/+3
2018-05-25rust-lang/rust#51025: improve test robustness so that they work under NLL too.Felix S. Klock II-14/+24
2018-04-11Checkpoint the current status of NLL on `ui` tests via compare-mode=nll.Felix S. Klock II-0/+10
2018-04-11Workaround rust-lang/rust#49855 by forcing rustc_error in any mode, ↵Felix S. Klock II-2/+2
including NLL. NOTE: I was careful to make each change in a manner that preserves the existing diagnostic output (usually by ensuring that no lines were added or removed). This means that the resulting source files are not as nice to read as they were at the start. But we will have to review these cases by hand anyway as follow-up work, so cleanup could reasonably happen then (or not at all).
2018-03-14update testsGuillaume Gomez-3/+3
2018-02-26Update UI testsVadim Petrochenkov-32/+32
2018-02-25Update ui testsGuillaume Gomez-0/+3
2017-12-16Auto merge of #46722 - arielb1:single-self, r=eddybbors-22/+49
fix broken assertion in type_param Nested generics (aka method generics) in trait methods don't have an *additional* Self parameter in their own type parameter list (they have a Self parameter in the parent generics), so don't try to check we're correctly adjusting for it. Fixes #46568. r? @eddyb
2017-12-14Point at var in short lived borrowsEsteban Küber-5/+5
2017-12-13fix broken assertion in type_paramAriel Ben-Yehuda-22/+49
Nested generics (aka method generics) in trait methods don't have an *additional* Self parameter in their own type parameter list (they have a Self parameter in the parent generics), so don't try to check we're correctly adjusting for it. Fixes #46568.
2017-11-26mention nightly in -Z external-macro-backtrace noteAlex Burka-1/+1
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-29/+39
2017-11-20address review commentsAlex Burka-1/+1
2017-11-19use -Z flag instead of env varAlex Burka-1/+1
2017-11-19update UI testsAlex Burka-1/+1
2017-10-02fix handling of `Self`Ariel Ben-Yehuda-15/+46
2017-10-01handle nested generics in Generics::type_param/region_paramAriel Ben-Yehuda-1/+44
Fixes #44952.
2017-09-24Point at parameter type on E0301Esteban Küber-0/+61
On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ```
2017-08-16Stabilize rvalue promotion to 'static.Eduard-Mihai Burtescu-4/+5
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-1/+1
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-05-27Add new error codes and update testsGuillaume Gomez-1/+1
2017-05-24Change error count messagesMichael Kohl-1/+1
See #33525 for details.
2017-01-26rustc: Remove all "consider using an explicit lifetime parameter" suggestionsBrian Anderson-53/+0
These give so many incorrect suggestions that having them is detrimental to the user experience. The compiler should not be suggesting changes to the code that are wrong - it is infuriating: not only is the compiler telling you that _you don't understand_ borrowing, _the compiler itself_ appears to not understand borrowing. It does not inspire confidence.
2016-11-23review commentsEsteban Küber-1/+1
2016-11-22Show multiline spans in full if short enoughEsteban Küber-2/+5
When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line. For example, instead of: ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ^ trait `{integer}: std::ops::Add<()>` not satisfied | ``` show ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ________^ starting here... 14 | | y), | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied | ```
2016-11-12Auto merge of #37554 - mikhail-m1:dnlle, r=jonathandturnerbors-2/+2
Improve "Doesn't live long enough" error case with temporary variable issue #36279 part of #35233 r? @jonathandturner
2016-11-10Don't hint to add lifetime on trait implEsteban Küber-0/+50
Don't provide hint to add lifetime on impl items that implement a trait. ```rust use std::str::FromStr; pub struct Foo<'a> { field: &'a str, } impl<'a> FromStr for Foo<'a> { type Err = (); fn from_str(path: &str) -> Result<Self, ()> { Ok(Foo { field: path }) } } ``` would give the following hint: ```nocode help: consider using an explicit lifetime parameter as shown: fn from_str(path: &'a str) -> Result<Self, ()> --> <anon>:9:5 | 9 | fn from_str(path: &str) -> Result<Self, ()> { | ^ ``` which is never correct, since then there will be a lifetime mismatch between the impl and the trait. Remove this hint for impl items that implement a trait.
2016-11-09Improve "Doesn't live long enough" errorMikhail Modin-2/+2
case with temporary variable
2016-08-31Update error message for lifetime of borrowed valuesJonathan Turner-0/+31