about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_infer/infer/error_reporting/mod.rs22
-rw-r--r--src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr2
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr2
-rw-r--r--src/test/ui/impl-trait/type_parameters_captured.stderr2
-rw-r--r--src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr10
-rw-r--r--src/test/ui/regions/regions-close-object-into-object-5.stderr14
-rw-r--r--src/test/ui/regions/regions-close-over-type-parameter-1.stderr8
-rw-r--r--src/test/ui/regions/regions-close-param-into-object.stderr8
-rw-r--r--src/test/ui/regions/regions-enum-not-wf.stderr8
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr2
-rw-r--r--src/test/ui/regions/regions-infer-bound-from-trait.stderr4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr2
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr8
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr4
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed2
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.rs2
-rw-r--r--src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr7
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr2
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-region.stderr2
-rw-r--r--src/test/ui/wf/wf-in-fn-type-static.stderr4
-rw-r--r--src/test/ui/wf/wf-in-obj-type-static.stderr2
-rw-r--r--src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr4
23 files changed, 62 insertions, 61 deletions
diff --git a/src/librustc_infer/infer/error_reporting/mod.rs b/src/librustc_infer/infer/error_reporting/mod.rs
index 77119b8618f..1ed890962da 100644
--- a/src/librustc_infer/infer/error_reporting/mod.rs
+++ b/src/librustc_infer/infer/error_reporting/mod.rs
@@ -1781,14 +1781,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
             bound_kind: GenericKind<'tcx>,
             sub: S,
         ) {
-            let consider = format!(
-                "consider adding an explicit lifetime bound {}",
-                if type_param_span.map(|(_, _, is_impl_trait)| is_impl_trait).unwrap_or(false) {
-                    format!(" `{}` to `{}`...", sub, bound_kind)
-                } else {
-                    format!("`{}: {}`...", bound_kind, sub)
-                },
-            );
+            let msg = "consider adding an explicit lifetime bound";
             if let Some((sp, has_lifetimes, is_impl_trait)) = type_param_span {
                 let suggestion = if is_impl_trait {
                     format!("{} + {}", bound_kind, sub)
@@ -1796,13 +1789,22 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
                     let tail = if has_lifetimes { " + " } else { "" };
                     format!("{}: {}{}", bound_kind, sub, tail)
                 };
-                err.span_suggestion_short(
+                err.span_suggestion(
                     sp,
-                    &consider,
+                    &format!("{}...", msg),
                     suggestion,
                     Applicability::MaybeIncorrect, // Issue #41966
                 );
             } else {
+                let consider = format!(
+                    "{} {}...",
+                    msg,
+                    if type_param_span.map(|(_, _, is_impl_trait)| is_impl_trait).unwrap_or(false) {
+                        format!(" `{}` to `{}`", sub, bound_kind)
+                    } else {
+                        format!("`{}: {}`", bound_kind, sub)
+                    },
+                );
                 err.help(&consider);
             }
         }
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr
index 2fdb3836dd9..999a5839ba6 100644
--- a/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr
@@ -4,7 +4,7 @@ error[E0310]: the parameter type `T` may not live long enough
 LL | impl <T: Sync> Foo for T { }
    |       --       ^^^
    |       |
-   |       help: consider adding an explicit lifetime bound `T: 'static`...
+   |       help: consider adding an explicit lifetime bound...: `T: 'static +`
    |
 note: ...so that the type `T` will meet its required lifetime bounds
   --> $DIR/builtin-superkinds-self-type.rs:10:16
diff --git a/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
index 689a3757343..fbc4e8abc42 100644
--- a/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
+++ b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `U` may not live long enough
   --> $DIR/feature-gate-infer_static_outlives_requirements.rs:5:5
    |
 LL | struct Foo<U> {
-   |            - help: consider adding an explicit lifetime bound `U: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `U: 'static`
 LL |     bar: Bar<U>
    |     ^^^^^^^^^^^
    |
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
index 7f92e709af5..cffa5ee8f14 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
@@ -67,7 +67,7 @@ error[E0310]: the parameter type `T` may not live long enough
 LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
    |                                 --                ^^^^^^^^^^^^^^^^^^^^
    |                                 |
-   |                                 help: consider adding an explicit lifetime bound `T: 'static`...
+   |                                 help: consider adding an explicit lifetime bound...: `T: 'static +`
    |
 note: ...so that the type `T` will meet its required lifetime bounds
   --> $DIR/must_outlive_least_region_or_bound.rs:22:51
diff --git a/src/test/ui/impl-trait/type_parameters_captured.stderr b/src/test/ui/impl-trait/type_parameters_captured.stderr
index 708b479ab17..34f0f7f1d73 100644
--- a/src/test/ui/impl-trait/type_parameters_captured.stderr
+++ b/src/test/ui/impl-trait/type_parameters_captured.stderr
@@ -4,7 +4,7 @@ error[E0310]: the parameter type `T` may not live long enough
 LL | fn foo<T>(x: T) -> impl Any + 'static {
    |        -           ^^^^^^^^^^^^^^^^^^
    |        |
-   |        help: consider adding an explicit lifetime bound `T: 'static`...
+   |        help: consider adding an explicit lifetime bound...: `T: 'static`
    |
 note: ...so that the type `T` will meet its required lifetime bounds
   --> $DIR/type_parameters_captured.rs:7:20
diff --git a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
index 4e50064efb4..e60c461743c 100644
--- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
+++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:19:5
    |
 LL | struct Foo<T> {
-   |            - help: consider adding an explicit lifetime bound `T: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     foo: &'static T
    |     ^^^^^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `K` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:24:19
    |
 LL | trait X<K>: Sized {
-   |         - help: consider adding an explicit lifetime bound `K: 'a`...
+   |         - help: consider adding an explicit lifetime bound...: `K: 'a`
 LL |     fn foo<'a, L: X<&'a Nested<K>>>();
    |                   ^^^^^^^^^^^^^^^^
    |
@@ -45,7 +45,7 @@ error[E0309]: the parameter type `L` may not live long enough
 LL |     fn baz<'a, L, M: X<&'a Nested<L>>>() {
    |                -     ^^^^^^^^^^^^^^^^
    |                |
-   |                help: consider adding an explicit lifetime bound `L: 'a`...
+   |                help: consider adding an explicit lifetime bound...: `L: 'a`
    |
 note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
   --> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
@@ -57,7 +57,7 @@ error[E0309]: the parameter type `K` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
    |
 LL | impl<K> Nested<K> {
-   |      - help: consider adding an explicit lifetime bound `K: 'a`...
+   |      - help: consider adding an explicit lifetime bound...: `K: 'a`
 LL |     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
    |                                 ^^^^^^^^^^^^^^^^
    |
@@ -71,7 +71,7 @@ error[E0309]: the parameter type `M` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
    |
 LL |     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
-   |                                    ^^^^^^^^^^^^^^^^  -- help: consider adding an explicit lifetime bound `M: 'a`...
+   |                                    ^^^^^^^^^^^^^^^^  -- help: consider adding an explicit lifetime bound...: `M: 'a +`
    |
 note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
   --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
diff --git a/src/test/ui/regions/regions-close-object-into-object-5.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr
index 7c530cec7c3..14727000b2c 100644
--- a/src/test/ui/regions/regions-close-object-into-object-5.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-5.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |     ^^^^^^^^^^
@@ -17,7 +17,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:5
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |     ^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:9
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |         ^
@@ -47,7 +47,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:9
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |         ^^^^^^
@@ -62,7 +62,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:11
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |           ^^^
@@ -77,7 +77,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:11
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |           ^^^
@@ -92,7 +92,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-object-into-object-5.rs:17:11
    |
 LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-   |          - help: consider adding an explicit lifetime bound `T: 'static`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // oh dear!
 LL |     box B(&*v) as Box<X>
    |           ^^^
diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr
index 81534b7b770..ed9a604e717 100644
--- a/src/test/ui/regions/regions-close-over-type-parameter-1.stderr
+++ b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `A` may not live long enough
   --> $DIR/regions-close-over-type-parameter-1.rs:10:5
    |
 LL | fn make_object1<A:SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
-   |                 -- help: consider adding an explicit lifetime bound `A: 'static`...
+   |                 -- help: consider adding an explicit lifetime bound...: `A: 'static +`
 LL |     box v as Box<dyn SomeTrait + 'static>
    |     ^^^^^
    |
@@ -16,7 +16,7 @@ error[E0310]: the parameter type `A` may not live long enough
   --> $DIR/regions-close-over-type-parameter-1.rs:10:5
    |
 LL | fn make_object1<A:SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
-   |                 -- help: consider adding an explicit lifetime bound `A: 'static`...
+   |                 -- help: consider adding an explicit lifetime bound...: `A: 'static +`
 LL |     box v as Box<dyn SomeTrait + 'static>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
@@ -30,7 +30,7 @@ error[E0309]: the parameter type `A` may not live long enough
   --> $DIR/regions-close-over-type-parameter-1.rs:20:5
    |
 LL | fn make_object3<'a,'b,A:SomeTrait+'a>(v: A) -> Box<dyn SomeTrait + 'b> {
-   |                       -- help: consider adding an explicit lifetime bound `A: 'b`...
+   |                       -- help: consider adding an explicit lifetime bound...: `A: 'b +`
 LL |     box v as Box<dyn SomeTrait + 'b>
    |     ^^^^^
    |
@@ -44,7 +44,7 @@ error[E0309]: the parameter type `A` may not live long enough
   --> $DIR/regions-close-over-type-parameter-1.rs:20:5
    |
 LL | fn make_object3<'a,'b,A:SomeTrait+'a>(v: A) -> Box<dyn SomeTrait + 'b> {
-   |                       -- help: consider adding an explicit lifetime bound `A: 'b`...
+   |                       -- help: consider adding an explicit lifetime bound...: `A: 'b +`
 LL |     box v as Box<dyn SomeTrait + 'b>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
diff --git a/src/test/ui/regions/regions-close-param-into-object.stderr b/src/test/ui/regions/regions-close-param-into-object.stderr
index 7f2c646c121..3b1a89d9ced 100644
--- a/src/test/ui/regions/regions-close-param-into-object.stderr
+++ b/src/test/ui/regions/regions-close-param-into-object.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-param-into-object.rs:6:5
    |
 LL | fn p1<T>(v: T) -> Box<dyn X + 'static>
-   |       - help: consider adding an explicit lifetime bound `T: 'static`...
+   |       - help: consider adding an explicit lifetime bound...: `T: 'static`
 ...
 LL |     Box::new(v)
    |     ^^^^^^^^^^^
@@ -17,7 +17,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-param-into-object.rs:12:5
    |
 LL | fn p2<T>(v: Box<T>) -> Box<dyn X + 'static>
-   |       - help: consider adding an explicit lifetime bound `T: 'static`...
+   |       - help: consider adding an explicit lifetime bound...: `T: 'static`
 ...
 LL |     Box::new(v)
    |     ^^^^^^^^^^^
@@ -32,7 +32,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-param-into-object.rs:18:5
    |
 LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 ...
 LL |     Box::new(v)
    |     ^^^^^^^^^^^
@@ -47,7 +47,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-close-param-into-object.rs:24:5
    |
 LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 ...
 LL |     Box::new(v)
    |     ^^^^^^^^^^^
diff --git a/src/test/ui/regions/regions-enum-not-wf.stderr b/src/test/ui/regions/regions-enum-not-wf.stderr
index 87014085667..297fcb088d2 100644
--- a/src/test/ui/regions/regions-enum-not-wf.stderr
+++ b/src/test/ui/regions/regions-enum-not-wf.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:18:18
    |
 LL | enum Ref1<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+   |               - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     Ref1Variant1(RequireOutlives<'a, T>)
    |                  ^^^^^^^^^^^^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:23:25
    |
 LL | enum Ref2<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+   |               - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     Ref2Variant1,
 LL |     Ref2Variant2(isize, RequireOutlives<'a, T>),
    |                         ^^^^^^^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:35:1
    |
 LL |   enum RefDouble<'a, 'b, T> {
-   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
+   |   ^                      - help: consider adding an explicit lifetime bound...: `T: 'b`
    |  _|
    | |
 LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
@@ -52,7 +52,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:36:23
    |
 LL | enum RefDouble<'a, 'b, T> {
-   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
+   |                        - help: consider adding an explicit lifetime bound...: `T: 'b`
 LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr
index 7fbc1622c3a..2f1a4cea8e9 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-implied-bounds-projection-gap-1.rs:16:10
    |
 LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo)
-   |             -- help: consider adding an explicit lifetime bound `T: 'x`...
+   |             -- help: consider adding an explicit lifetime bound...: `T: 'x +`
 LL | {
 LL |     wf::<&'x T>();
    |          ^^^^^
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
index 382d932e81a..a5a0ff52fac 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait.stderr
+++ b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `A` may not live long enough
   --> $DIR/regions-infer-bound-from-trait.rs:33:5
    |
 LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
-   |            - help: consider adding an explicit lifetime bound `A: 'a`...
+   |            - help: consider adding an explicit lifetime bound...: `A: 'a`
 LL |     check_bound(x, a)
    |     ^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `A` may not live long enough
   --> $DIR/regions-infer-bound-from-trait.rs:37:5
    |
 LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
-   |               -- help: consider adding an explicit lifetime bound `A: 'a`...
+   |               -- help: consider adding an explicit lifetime bound...: `A: 'a +`
 LL |     check_bound(x, a)
    |     ^^^^^^^^^^^
    |
diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
index b049d8a4ab3..c3cfc5a4d97 100644
--- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `U` may not live long enough
   --> $DIR/dont-infer-static.rs:8:5
    |
 LL | struct Foo<U> {
-   |            - help: consider adding an explicit lifetime bound `U: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `U: 'static`
 LL |     bar: Bar<U>
    |     ^^^^^^^^^^^
    |
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
index 87014085667..297fcb088d2 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:18:18
    |
 LL | enum Ref1<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+   |               - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     Ref1Variant1(RequireOutlives<'a, T>)
    |                  ^^^^^^^^^^^^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:23:25
    |
 LL | enum Ref2<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+   |               - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     Ref2Variant1,
 LL |     Ref2Variant2(isize, RequireOutlives<'a, T>),
    |                         ^^^^^^^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:35:1
    |
 LL |   enum RefDouble<'a, 'b, T> {
-   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
+   |   ^                      - help: consider adding an explicit lifetime bound...: `T: 'b`
    |  _|
    | |
 LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
@@ -52,7 +52,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-enum-not-wf.rs:36:23
    |
 LL | enum RefDouble<'a, 'b, T> {
-   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
+   |                        - help: consider adding an explicit lifetime bound...: `T: 'b`
 LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
index 825c1015c51..f6658891fa6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-struct-not-wf.rs:13:5
    |
 LL | impl<'a, T> Trait<'a, T> for usize {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     type Out = &'a T;
    |     ^^^^^^^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/regions-struct-not-wf.rs:21:5
    |
 LL | impl<'a, T> Trait<'a, T> for u32 {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     type Out = RefOk<'a, T>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
index 8592af1262e..589ee1a474a 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
@@ -3,7 +3,7 @@
 use std::fmt::Debug;
 
 fn foo(d: impl Debug + 'static) {
-//~^ HELP consider adding an explicit lifetime bound  `'static` to `impl Debug`
+//~^ HELP consider adding an explicit lifetime bound...
     bar(d);
 //~^ ERROR the parameter type `impl Debug` may not live long enough
 //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
index c67d78ea4c7..9a87129fbf2 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
@@ -3,7 +3,7 @@
 use std::fmt::Debug;
 
 fn foo(d: impl Debug) {
-//~^ HELP consider adding an explicit lifetime bound  `'static` to `impl Debug`
+//~^ HELP consider adding an explicit lifetime bound...
     bar(d);
 //~^ ERROR the parameter type `impl Debug` may not live long enough
 //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
index cba231d0e86..b6e6c0bbf32 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
@@ -1,6 +1,9 @@
 error[E0310]: the parameter type `impl Debug` may not live long enough
   --> $DIR/suggest-impl-trait-lifetime.rs:7:5
    |
+LL | fn foo(d: impl Debug) {
+   |           ---------- help: consider adding an explicit lifetime bound...: `impl Debug + 'static`
+LL |
 LL |     bar(d);
    |     ^^^
    |
@@ -9,10 +12,6 @@ note: ...so that the type `impl Debug` will meet its required lifetime bounds
    |
 LL |     bar(d);
    |     ^^^
-help: consider adding an explicit lifetime bound  `'static` to `impl Debug`...
-   |
-LL | fn foo(d: impl Debug + 'static) {
-   |           ^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
index 5a7f9d74eba..22e2391f838 100644
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
@@ -25,7 +25,7 @@ LL | type WrongGeneric<T> = impl 'static;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
-   |                  - help: consider adding an explicit lifetime bound `T: 'static`...
+   |                  - help: consider adding an explicit lifetime bound...: `T: 'static`
    |
 note: ...so that the type `T` will meet its required lifetime bounds
   --> $DIR/generic_type_does_not_live_long_enough.rs:9:1
diff --git a/src/test/ui/wf/wf-impl-associated-type-region.stderr b/src/test/ui/wf/wf-impl-associated-type-region.stderr
index 9cc36025305..9942c80effe 100644
--- a/src/test/ui/wf/wf-impl-associated-type-region.stderr
+++ b/src/test/ui/wf/wf-impl-associated-type-region.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/wf-impl-associated-type-region.rs:10:5
    |
 LL | impl<'a, T> Foo<'a> for T {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     type Bar = &'a T;
    |     ^^^^^^^^^^^^^^^^^
    |
diff --git a/src/test/ui/wf/wf-in-fn-type-static.stderr b/src/test/ui/wf/wf-in-fn-type-static.stderr
index 8952c78aacd..7dc8f5a9661 100644
--- a/src/test/ui/wf/wf-in-fn-type-static.stderr
+++ b/src/test/ui/wf/wf-in-fn-type-static.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/wf-in-fn-type-static.rs:13:5
    |
 LL | struct Foo<T> {
-   |            - help: consider adding an explicit lifetime bound `T: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // needs T: 'static
 LL |     x: fn() -> &'static T
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/wf-in-fn-type-static.rs:18:5
    |
 LL | struct Bar<T> {
-   |            - help: consider adding an explicit lifetime bound `T: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // needs T: Copy
 LL |     x: fn(&'static T)
    |     ^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/wf/wf-in-obj-type-static.stderr b/src/test/ui/wf/wf-in-obj-type-static.stderr
index c461da76a25..32c3198d55b 100644
--- a/src/test/ui/wf/wf-in-obj-type-static.stderr
+++ b/src/test/ui/wf/wf-in-obj-type-static.stderr
@@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/wf-in-obj-type-static.rs:14:5
    |
 LL | struct Foo<T> {
-   |            - help: consider adding an explicit lifetime bound `T: 'static`...
+   |            - help: consider adding an explicit lifetime bound...: `T: 'static`
 LL |     // needs T: 'static
 LL |     x: dyn Object<&'static T>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
index f1cf514e6b2..52786fb3bca 100644
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
+++ b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
@@ -2,7 +2,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
    |
 LL | impl<'a, T> Trait<'a, T> for usize {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     type Out = &'a fn(T);
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
@@ -16,7 +16,7 @@ error[E0309]: the parameter type `T` may not live long enough
   --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
    |
 LL | impl<'a, T> Trait<'a, T> for u32 {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
+   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
 LL |     type Out = &'a dyn Baz<T>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |