about summary refs log tree commit diff
path: root/tests/ui/underscore-lifetime
AgeCommit message (Collapse)AuthorLines
2025-07-18Remove similar errors about raw underscore lifetimexizheyin-9/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-18Add test raw-underscore-lifetime.rsxizheyin-0/+25
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-11Rollup merge of #143302 - Kivooeo:tf27, r=tgross35Matthias Krüger-0/+38
`tests/ui`: A New Order [27/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ``@tgross35``
2025-07-10cleaned up some testsKivooeo-4/+4
2025-07-01moved testsKivooeo-0/+38
2025-07-01Suggest use another lifetime specifier instead of underscore lifetimexizheyin-0/+16
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-10/+15
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-01-06`best_blame_constraint`: don't filter constraints by sup SCCdianne-0/+3
The SCCs of the region graph are not a reliable heuristic to use for blaming an interesting constraint for diagnostics. For region errors, if the outlived region is `'static`, or the involved types are invariant in their lifetiems, there will be cycles in the constraint graph containing both the target region and the most interesting constraints to blame. To get better diagnostics in these cases, this commit removes that heuristic.
2024-03-20make `type_flags(ReError) & HAS_ERROR`Ali MJ Al-Nasrawy-10/+1
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-16/+16
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-1/+10
2024-02-07Update testsr0cky-4/+14
2023-12-12Rollup merge of #117914 - estebank:issue-85843, r=wesleywiserMatthias Krüger-1/+1
On borrow return type, suggest borrowing from arg or owned return type When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-11-24Show number in error message even for one errorNilstrieb-13/+13
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-20On borrow return type, suggest borrowing from arg or owned return typeEsteban Küber-1/+1
When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-06-30Use structured suggestion when telling user about `for<'a>`Esteban Küber-53/+144
``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
2023-01-11Move /src/test to /testsAlbert Larsan-0/+492