about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-06-24 18:59:29 +0000
committerMichael Goulet <michael@errs.io>2025-06-24 18:59:42 +0000
commit250b5d204f499c326699b0e2adf7d7757e55f16c (patch)
tree5dae4bb56bf85510af0f57a61e904a7e8fad763f /tests
parent36b21637e93b038453924d3c66821089e71d8baa (diff)
downloadrust-250b5d204f499c326699b0e2adf7d7757e55f16c.tar.gz
rust-250b5d204f499c326699b0e2adf7d7757e55f16c.zip
Make missing lifetime suggestion verbose
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/associated-inherent-types/issue-109299.stderr9
-rw-r--r--tests/ui/borrowck/generic_const_early_param.stderr17
-rw-r--r--tests/ui/cast/ice-cast-type-with-error-124848.stderr25
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.stderr7
-rw-r--r--tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr9
-rw-r--r--tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr9
-rw-r--r--tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr18
-rw-r--r--tests/ui/error-codes/E0261.stderr16
-rw-r--r--tests/ui/generics/generic-extern-lifetime.stderr9
-rw-r--r--tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr9
-rw-r--r--tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr9
-rw-r--r--tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr9
-rw-r--r--tests/ui/inference/issue-107090.stderr25
-rw-r--r--tests/ui/lifetimes/issue-107988.stderr9
-rw-r--r--tests/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr13
-rw-r--r--tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr9
-rw-r--r--tests/ui/methods/method-call-lifetime-args-unresolved.stderr7
-rw-r--r--tests/ui/nll/user-annotations/region-error-ice-109072.stderr9
-rw-r--r--tests/ui/regions/regions-in-enums.stderr14
-rw-r--r--tests/ui/regions/regions-in-structs.stderr15
-rw-r--r--tests/ui/regions/regions-name-undeclared.stderr49
-rw-r--r--tests/ui/regions/regions-undeclared.stderr31
-rw-r--r--tests/ui/statics/missing_lifetime.stderr9
-rw-r--r--tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr9
-rw-r--r--tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr9
-rw-r--r--tests/ui/traits/span-bug-issue-121414.stderr9
26 files changed, 246 insertions, 117 deletions
diff --git a/tests/ui/associated-inherent-types/issue-109299.stderr b/tests/ui/associated-inherent-types/issue-109299.stderr
index 1e11c0e8c2a..f29d3cc7834 100644
--- a/tests/ui/associated-inherent-types/issue-109299.stderr
+++ b/tests/ui/associated-inherent-types/issue-109299.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'d`
   --> $DIR/issue-109299.rs:6:12
    |
 LL | impl Lexer<'d> {
-   |     -      ^^ undeclared lifetime
-   |     |
-   |     help: consider introducing lifetime `'d` here: `<'d>`
+   |            ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'d` here
+   |
+LL | impl<'d> Lexer<'d> {
+   |     ++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/borrowck/generic_const_early_param.stderr b/tests/ui/borrowck/generic_const_early_param.stderr
index 3f56d6a3325..6447f92aba8 100644
--- a/tests/ui/borrowck/generic_const_early_param.stderr
+++ b/tests/ui/borrowck/generic_const_early_param.stderr
@@ -7,19 +7,24 @@ LL | struct DataWrapper<'static> {
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/generic_const_early_param.rs:6:12
    |
-LL | struct DataWrapper<'static> {
-   |                    - help: consider introducing lifetime `'a` here: `'a,`
-LL |
 LL |     data: &'a [u8; Self::SIZE],
    |            ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | struct DataWrapper<'a, 'static> {
+   |                    +++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/generic_const_early_param.rs:10:18
    |
 LL | impl DataWrapper<'a> {
-   |     -            ^^ undeclared lifetime
-   |     |
-   |     help: consider introducing lifetime `'a` here: `<'a>`
+   |                  ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | impl<'a> DataWrapper<'a> {
+   |     ++++
 
 warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
   --> $DIR/generic_const_early_param.rs:1:12
diff --git a/tests/ui/cast/ice-cast-type-with-error-124848.stderr b/tests/ui/cast/ice-cast-type-with-error-124848.stderr
index 0b2ab1dfc4c..316a484d971 100644
--- a/tests/ui/cast/ice-cast-type-with-error-124848.stderr
+++ b/tests/ui/cast/ice-cast-type-with-error-124848.stderr
@@ -2,27 +2,34 @@ error[E0261]: use of undeclared lifetime name `'unpinned`
   --> $DIR/ice-cast-type-with-error-124848.rs:7:32
    |
 LL | struct MyType<'a>(Cell<Option<&'unpinned mut MyType<'a>>>, Pin);
-   |               -                ^^^^^^^^^ undeclared lifetime
-   |               |
-   |               help: consider introducing lifetime `'unpinned` here: `'unpinned,`
+   |                                ^^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'unpinned` here
+   |
+LL | struct MyType<'unpinned, 'a>(Cell<Option<&'unpinned mut MyType<'a>>>, Pin);
+   |               ++++++++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/ice-cast-type-with-error-124848.rs:14:53
    |
-LL | fn main() {
-   |        - help: consider introducing lifetime `'a` here: `<'a>`
-...
 LL |     let bad_addr = &unpinned as *const Cell<Option<&'a mut MyType<'a>>> as usize;
    |                                                     ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn main<'a>() {
+   |        ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/ice-cast-type-with-error-124848.rs:14:67
    |
-LL | fn main() {
-   |        - help: consider introducing lifetime `'a` here: `<'a>`
-...
 LL |     let bad_addr = &unpinned as *const Cell<Option<&'a mut MyType<'a>>> as usize;
    |                                                                   ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn main<'a>() {
+   |        ++++
 
 error[E0412]: cannot find type `Pin` in this scope
   --> $DIR/ice-cast-type-with-error-124848.rs:7:60
diff --git a/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.stderr b/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.stderr
index 67eed46eadd..ae074373da2 100644
--- a/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.stderr
@@ -1,10 +1,13 @@
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/unresolved_lifetimes_error.rs:5:13
    |
-LL | fn foo() -> [(); {
-   |       - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     let a: &'a ();
    |             ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn foo<'a>() -> [(); {
+   |       ++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr
index afad3388145..3b24808cd16 100644
--- a/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr
+++ b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr
@@ -17,9 +17,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/ice-unexpected-inference-var-122549.rs:11:34
    |
 LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {}
-   |                         -        ^^ undeclared lifetime
-   |                         |
-   |                         help: consider introducing lifetime `'a` here: `'a,`
+   |                                  ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | struct ConstChunksExact<'a, 'rem, T: 'a, const N: usize> {}
+   |                         +++
 
 error[E0046]: not all trait items implemented, missing: `const_chunks_exact`
   --> $DIR/ice-unexpected-inference-var-122549.rs:9:1
diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
index d95a8861230..586c96011e4 100644
--- a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
+++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/ice-type-mismatch-when-copying-112824.rs:5:21
    |
 LL | pub struct Opcode2(&'a S);
-   |                   - ^^ undeclared lifetime
-   |                   |
-   |                   help: consider introducing lifetime `'a` here: `<'a>`
+   |                     ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | pub struct Opcode2<'a>(&'a S);
+   |                   ++++
 
 error[E0412]: cannot find type `S` in this scope
   --> $DIR/ice-type-mismatch-when-copying-112824.rs:5:24
diff --git a/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr b/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr
index 2cf244185e6..83a0a77d842 100644
--- a/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr
+++ b/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr
@@ -139,9 +139,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs:96:12
    |
 LL | fn bar(_: &'a Trait) {}
-   |       -    ^^ undeclared lifetime
-   |       |
-   |       help: consider introducing lifetime `'a` here: `<'a>`
+   |            ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn bar<'a>(_: &'a Trait) {}
+   |       ++++
 
 error[E0106]: missing lifetime specifier
   --> $DIR/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs:110:13
@@ -171,9 +174,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs:122:17
    |
 LL | fn kitten() -> &'a Trait {
-   |          -      ^^ undeclared lifetime
-   |          |
-   |          help: consider introducing lifetime `'a` here: `<'a>`
+   |                 ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn kitten<'a>() -> &'a Trait {
+   |          ++++
 
 error[E0106]: missing lifetime specifier
   --> $DIR/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs:133:16
diff --git a/tests/ui/error-codes/E0261.stderr b/tests/ui/error-codes/E0261.stderr
index 0eab2dc0ee0..9ca26dc8459 100644
--- a/tests/ui/error-codes/E0261.stderr
+++ b/tests/ui/error-codes/E0261.stderr
@@ -2,17 +2,23 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/E0261.rs:1:12
    |
 LL | fn foo(x: &'a str) { }
-   |       -    ^^ undeclared lifetime
-   |       |
-   |       help: consider introducing lifetime `'a` here: `<'a>`
+   |            ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn foo<'a>(x: &'a str) { }
+   |       ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/E0261.rs:5:9
    |
-LL | struct Foo {
-   |           - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     x: &'a str,
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | struct Foo<'a> {
+   |           ++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/generics/generic-extern-lifetime.stderr b/tests/ui/generics/generic-extern-lifetime.stderr
index 33332e760f5..6f9b496f1cd 100644
--- a/tests/ui/generics/generic-extern-lifetime.stderr
+++ b/tests/ui/generics/generic-extern-lifetime.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/generic-extern-lifetime.rs:6:26
    |
 LL |     pub fn life2<'b>(x: &'a i32, y: &'b i32);
-   |                  -       ^^ undeclared lifetime
-   |                  |
-   |                  help: consider introducing lifetime `'a` here: `'a,`
+   |                          ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     pub fn life2<'a, 'b>(x: &'a i32, y: &'b i32);
+   |                  +++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/generic-extern-lifetime.rs:8:37
diff --git a/tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr b/tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr
index c60c4c72a21..33d0c9c9707 100644
--- a/tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr
+++ b/tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:7:13
    |
 LL | impl Foo<T: 'a + Default> for u8 {}
-   |     -       ^^ undeclared lifetime
-   |     |
-   |     help: consider introducing lifetime `'a` here: `<'a>`
+   |             ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | impl<'a> Foo<T: 'a + Default> for u8 {}
+   |     ++++
 
 error[E0229]: associated item constraints are not allowed here
   --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:3:10
diff --git a/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr b/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr
index 98f629f52cf..ddb09690faf 100644
--- a/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr
+++ b/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr
@@ -15,9 +15,12 @@ error[E0261]: use of undeclared lifetime name `'missing`
   --> $DIR/bad-lifetimes.rs:7:37
    |
 LL | fn missing_lt() -> impl Sized + use<'missing> {}
-   |              -                      ^^^^^^^^ undeclared lifetime
-   |              |
-   |              help: consider introducing lifetime `'missing` here: `<'missing>`
+   |                                     ^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'missing` here
+   |
+LL | fn missing_lt<'missing>() -> impl Sized + use<'missing> {}
+   |              ++++++++++
 
 error: expected lifetime parameter in `use<...>` precise captures list, found `'static`
   --> $DIR/bad-lifetimes.rs:4:36
diff --git a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
index ce01e24770d..c2ebaee2441 100644
--- a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
+++ b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
@@ -23,9 +23,12 @@ error[E0261]: use of undeclared lifetime name `'q`
   --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:14:21
    |
 LL | impl<'static> Query<'q> {
-   |      -              ^^ undeclared lifetime
-   |      |
-   |      help: consider introducing lifetime `'q` here: `'q,`
+   |                     ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'q` here
+   |
+LL | impl<'q, 'static> Query<'q> {
+   |      +++
 
 error[E0392]: lifetime parameter `'q` is never used
   --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:11:14
diff --git a/tests/ui/inference/issue-107090.stderr b/tests/ui/inference/issue-107090.stderr
index e509e262fb1..0deafdfb931 100644
--- a/tests/ui/inference/issue-107090.stderr
+++ b/tests/ui/inference/issue-107090.stderr
@@ -33,15 +33,23 @@ error[E0261]: use of undeclared lifetime name `'b`
   --> $DIR/issue-107090.rs:11:47
    |
 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
-   |      -                                        ^^ undeclared lifetime
-   |      |
-   |      help: consider introducing lifetime `'b` here: `'b,`
+   |                                               ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'b` here
+   |
+LL | impl<'b, 'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
+   |      +++
 
 error[E0261]: use of undeclared lifetime name `'out`
   --> $DIR/issue-107090.rs:11:67
    |
 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
-   |      - help: consider introducing lifetime `'out` here: `'out,`   ^^^^ undeclared lifetime
+   |                                                                   ^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'out` here
+   |
+LL | impl<'out, 'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
+   |      +++++
 
 error[E0261]: use of undeclared lifetime name `'out`
   --> $DIR/issue-107090.rs:14:49
@@ -62,9 +70,12 @@ error[E0261]: use of undeclared lifetime name `'short`
   --> $DIR/issue-107090.rs:20:68
    |
 LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
-   |           -                                                        ^^^^^^ undeclared lifetime
-   |           |
-   |           help: consider introducing lifetime `'short` here: `'short,`
+   |                                                                    ^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'short` here
+   |
+LL | fn badboi<'short, 'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
+   |           +++++++
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/lifetimes/issue-107988.stderr b/tests/ui/lifetimes/issue-107988.stderr
index c2d8c7050e9..7d93c1d2024 100644
--- a/tests/ui/lifetimes/issue-107988.stderr
+++ b/tests/ui/lifetimes/issue-107988.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'tcx`
   --> $DIR/issue-107988.rs:7:52
    |
 LL | impl<T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
-   |      -                                             ^^^^ undeclared lifetime
-   |      |
-   |      help: consider introducing lifetime `'tcx` here: `'tcx,`
+   |                                                    ^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'tcx` here
+   |
+LL | impl<'tcx, T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
+   |      +++++
 
 error[E0261]: use of undeclared lifetime name `'tcx`
   --> $DIR/issue-107988.rs:7:30
diff --git a/tests/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr b/tests/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
index 0d6ade41511..f90133e9fb1 100644
--- a/tests/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
+++ b/tests/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
@@ -1,10 +1,13 @@
 error[E0261]: use of undeclared lifetime name `'b`
   --> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9
    |
-LL | struct Test {
-   |            - help: consider introducing lifetime `'b` here: `<'b>`
 LL |     a: &'b str,
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'b` here
+   |
+LL | struct Test<'b> {
+   |            ++++
 
 error[E0261]: use of undeclared lifetime name `'b`
   --> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9
@@ -12,9 +15,13 @@ error[E0261]: use of undeclared lifetime name `'b`
 LL | #[derive(Eq, PartialEq)]
    |          -- lifetime `'b` is missing in item created through this procedural macro
 LL | struct Test {
-   |            - help: consider introducing lifetime `'b` here: `<'b>`
 LL |     a: &'b str,
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'b` here
+   |
+LL | struct Test<'b> {
+   |            ++++
 
 error[E0261]: use of undeclared lifetime name `'b`
   --> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:13:13
diff --git a/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr
index 2c33941be43..00267ce359a 100644
--- a/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr
+++ b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'missing`
   --> $DIR/dont-ice-on-object-lookup-w-error-region.rs:6:20
    |
 LL | fn project(x: Pin<&'missing mut dyn Future<Output = ()>>) {
-   |           -        ^^^^^^^^ undeclared lifetime
-   |           |
-   |           help: consider introducing lifetime `'missing` here: `<'missing>`
+   |                    ^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'missing` here
+   |
+LL | fn project<'missing>(x: Pin<&'missing mut dyn Future<Output = ()>>) {
+   |           ++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/methods/method-call-lifetime-args-unresolved.stderr b/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
index c72e7e0cdc3..d3bd74a49fb 100644
--- a/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
+++ b/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
@@ -1,10 +1,13 @@
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/method-call-lifetime-args-unresolved.rs:2:15
    |
-LL | fn main() {
-   |        - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     0.clone::<'a>();
    |               ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn main<'a>() {
+   |        ++++
 
 warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
   --> $DIR/method-call-lifetime-args-unresolved.rs:2:15
diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr
index d90971bed25..42551b87f62 100644
--- a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr
+++ b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'missing`
   --> $DIR/region-error-ice-109072.rs:8:9
    |
 LL | impl Lt<'missing> for () {
-   |     -   ^^^^^^^^ undeclared lifetime
-   |     |
-   |     help: consider introducing lifetime `'missing` here: `<'missing>`
+   |         ^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'missing` here
+   |
+LL | impl<'missing> Lt<'missing> for () {
+   |     ++++++++++
 
 error[E0261]: use of undeclared lifetime name `'missing`
   --> $DIR/region-error-ice-109072.rs:9:15
diff --git a/tests/ui/regions/regions-in-enums.stderr b/tests/ui/regions/regions-in-enums.stderr
index 66537653291..449763e8b59 100644
--- a/tests/ui/regions/regions-in-enums.stderr
+++ b/tests/ui/regions/regions-in-enums.stderr
@@ -1,18 +1,24 @@
 error[E0261]: use of undeclared lifetime name `'foo`
   --> $DIR/regions-in-enums.rs:13:9
    |
-LL | enum No0 {
-   |         - help: consider introducing lifetime `'foo` here: `<'foo>`
 LL |     X5(&'foo usize)
    |         ^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'foo` here
+   |
+LL | enum No0<'foo> {
+   |         ++++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-in-enums.rs:17:9
    |
-LL | enum No1 {
-   |         - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     X6(&'a usize)
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | enum No1<'a> {
+   |         ++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/regions/regions-in-structs.stderr b/tests/ui/regions/regions-in-structs.stderr
index 5dfdc2ee93b..c34b1ffca64 100644
--- a/tests/ui/regions/regions-in-structs.stderr
+++ b/tests/ui/regions/regions-in-structs.stderr
@@ -1,19 +1,24 @@
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-in-structs.rs:10:9
    |
-LL | struct StructDecl {
-   |                  - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     a: &'a isize,
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | struct StructDecl<'a> {
+   |                  ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-in-structs.rs:11:9
    |
-LL | struct StructDecl {
-   |                  - help: consider introducing lifetime `'a` here: `<'a>`
-LL |     a: &'a isize,
 LL |     b: &'a isize,
    |         ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | struct StructDecl<'a> {
+   |                  ++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/regions/regions-name-undeclared.stderr b/tests/ui/regions/regions-name-undeclared.stderr
index 532603de5f7..06e6f4299de 100644
--- a/tests/ui/regions/regions-name-undeclared.stderr
+++ b/tests/ui/regions/regions-name-undeclared.stderr
@@ -50,9 +50,12 @@ LL | fn bar<'a>(x: &'a isize) {
    |        -- lifetime parameter from outer item
 ...
 LL |     type X = Option<&'a isize>;
-   |           -          ^^ use of generic parameter from outer item
-   |           |
-   |           help: consider introducing lifetime `'a` here: `<'a>`
+   |                      ^^ use of generic parameter from outer item
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     type X<'a> = Option<&'a isize>;
+   |           ++++
 
 error[E0401]: can't use generic parameters from outer item
   --> $DIR/regions-name-undeclared.rs:28:13
@@ -60,10 +63,13 @@ error[E0401]: can't use generic parameters from outer item
 LL | fn bar<'a>(x: &'a isize) {
    |        -- lifetime parameter from outer item
 ...
-LL |     enum E {
-   |           - help: consider introducing lifetime `'a` here: `<'a>`
 LL |         E1(&'a isize)
    |             ^^ use of generic parameter from outer item
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     enum E<'a> {
+   |           ++++
 
 error[E0401]: can't use generic parameters from outer item
   --> $DIR/regions-name-undeclared.rs:31:13
@@ -71,10 +77,13 @@ error[E0401]: can't use generic parameters from outer item
 LL | fn bar<'a>(x: &'a isize) {
    |        -- lifetime parameter from outer item
 ...
-LL |     struct S {
-   |             - help: consider introducing lifetime `'a` here: `<'a>`
 LL |         f: &'a isize
    |             ^^ use of generic parameter from outer item
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     struct S<'a> {
+   |             ++++
 
 error[E0401]: can't use generic parameters from outer item
   --> $DIR/regions-name-undeclared.rs:33:14
@@ -83,17 +92,23 @@ LL | fn bar<'a>(x: &'a isize) {
    |        -- lifetime parameter from outer item
 ...
 LL |     fn f(a: &'a isize) { }
-   |         -    ^^ use of generic parameter from outer item
-   |         |
-   |         help: consider introducing lifetime `'a` here: `<'a>`
+   |              ^^ use of generic parameter from outer item
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     fn f<'a>(a: &'a isize) { }
+   |         ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-name-undeclared.rs:41:17
    |
 LL | fn fn_types(a: &'a isize,
-   |            -    ^^ undeclared lifetime
-   |            |
-   |            help: consider introducing lifetime `'a` here: `<'a>`
+   |                 ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn fn_types<'a>(a: &'a isize,
+   |            ++++
 
 error[E0261]: use of undeclared lifetime name `'b`
   --> $DIR/regions-name-undeclared.rs:43:36
@@ -129,11 +144,13 @@ LL | fn fn_types<'b>(a: &'a isize,
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-name-undeclared.rs:47:17
    |
-LL | fn fn_types(a: &'a isize,
-   |            - help: consider introducing lifetime `'a` here: `<'a>`
-...
 LL |             c: &'a isize)
    |                 ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn fn_types<'a>(a: &'a isize,
+   |            ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-name-undeclared.rs:53:31
diff --git a/tests/ui/regions/regions-undeclared.stderr b/tests/ui/regions/regions-undeclared.stderr
index 6bfde5524ac..2bc0f184803 100644
--- a/tests/ui/regions/regions-undeclared.stderr
+++ b/tests/ui/regions/regions-undeclared.stderr
@@ -7,35 +7,46 @@ LL | static c_x: &'blk isize = &22;
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-undeclared.rs:4:10
    |
-LL | enum EnumDecl {
-   |              - help: consider introducing lifetime `'a` here: `<'a>`
 LL |     Foo(&'a isize),
    |          ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | enum EnumDecl<'a> {
+   |              ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-undeclared.rs:5:10
    |
-LL | enum EnumDecl {
-   |              - help: consider introducing lifetime `'a` here: `<'a>`
-LL |     Foo(&'a isize),
 LL |     Bar(&'a isize),
    |          ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | enum EnumDecl<'a> {
+   |              ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-undeclared.rs:8:15
    |
 LL | fn fnDecl(x: &'a isize,
-   |          -    ^^ undeclared lifetime
-   |          |
-   |          help: consider introducing lifetime `'a` here: `<'a>`
+   |               ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn fnDecl<'a>(x: &'a isize,
+   |          ++++
 
 error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/regions-undeclared.rs:9:15
    |
-LL | fn fnDecl(x: &'a isize,
-   |          - help: consider introducing lifetime `'a` here: `<'a>`
 LL |           y: &'a isize)
    |               ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn fnDecl<'a>(x: &'a isize,
+   |          ++++
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/statics/missing_lifetime.stderr b/tests/ui/statics/missing_lifetime.stderr
index e23b27f7a6a..102670c3642 100644
--- a/tests/ui/statics/missing_lifetime.stderr
+++ b/tests/ui/statics/missing_lifetime.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'reborrow`
   --> $DIR/missing_lifetime.rs:4:15
    |
 LL | struct Slice(&'reborrow [&'static [u8]]);
-   |             - ^^^^^^^^^ undeclared lifetime
-   |             |
-   |             help: consider introducing lifetime `'reborrow` here: `<'reborrow>`
+   |               ^^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'reborrow` here
+   |
+LL | struct Slice<'reborrow>(&'reborrow [&'static [u8]]);
+   |             +++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
index 0aa33d3b6fb..ab067f2439c 100644
--- a/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
+++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> $DIR/missing-lifetimes-in-signature.rs:37:11
    |
 LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |        -  ^^ undeclared lifetime
-   |        |
-   |        help: consider introducing lifetime `'a` here: `'a,`
+   |           ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL | fn baz<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
+   |        +++
 
 error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
   --> $DIR/missing-lifetimes-in-signature.rs:19:5
diff --git a/tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr b/tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr
index cf85c52fb42..989ee1c6d7c 100644
--- a/tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr
+++ b/tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'missing`
   --> $DIR/dont-canonicalize-re-error.rs:25:26
    |
 LL | impl<A: Sized> Constrain<'missing> for W<A> {}
-   |      -                   ^^^^^^^^ undeclared lifetime
-   |      |
-   |      help: consider introducing lifetime `'missing` here: `'missing,`
+   |                          ^^^^^^^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'missing` here
+   |
+LL | impl<'missing, A: Sized> Constrain<'missing> for W<A> {}
+   |      +++++++++
 
 error[E0119]: conflicting implementations of trait `Tr<'_>` for type `W<_>`
   --> $DIR/dont-canonicalize-re-error.rs:21:1
diff --git a/tests/ui/traits/span-bug-issue-121414.stderr b/tests/ui/traits/span-bug-issue-121414.stderr
index 744806a3415..2eeda00d9cb 100644
--- a/tests/ui/traits/span-bug-issue-121414.stderr
+++ b/tests/ui/traits/span-bug-issue-121414.stderr
@@ -2,9 +2,12 @@ error[E0261]: use of undeclared lifetime name `'f`
   --> $DIR/span-bug-issue-121414.rs:5:22
    |
 LL | impl<'a> Bar for Foo<'f> {
-   |      -               ^^ undeclared lifetime
-   |      |
-   |      help: consider introducing lifetime `'f` here: `'f,`
+   |                      ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'f` here
+   |
+LL | impl<'f, 'a> Bar for Foo<'f> {
+   |      +++
 
 error: aborting due to 1 previous error