about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-12 22:10:29 -0400
committerMichael Goulet <michael@errs.io>2024-08-17 12:43:25 -0400
commit84044cd50f3db13defbd96e6720da62140679a25 (patch)
tree4f12791f856b6b9dee30ce2858f67bd044458309
parenteae5b5c6e7d5804f7c0a6080444709b3c77b3443 (diff)
downloadrust-84044cd50f3db13defbd96e6720da62140679a25.tar.gz
rust-84044cd50f3db13defbd96e6720da62140679a25.zip
Bless test fallout
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/infer/region.rs22
-rw-r--r--tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr6
-rw-r--r--tests/ui/borrowck/alias-liveness/opaque-type-param.stderr5
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-109141.stderr6
-rw-r--r--tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr6
-rw-r--r--tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr6
-rw-r--r--tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.stderr6
-rw-r--r--tests/ui/impl-trait/hidden-lifetimes.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr2
-rw-r--r--tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr18
-rw-r--r--tests/ui/impl-trait/nested-return-type4.stderr10
-rw-r--r--tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.rs2
-rw-r--r--tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr16
-rw-r--r--tests/ui/impl-trait/region-escape-via-bound.stderr6
-rw-r--r--tests/ui/impl-trait/static-return-lifetime-infered.stderr12
-rw-r--r--tests/ui/lifetimes/issue-105227.fixed26
-rw-r--r--tests/ui/lifetimes/issue-105227.rs16
-rw-r--r--tests/ui/lifetimes/issue-105227.stderr33
-rw-r--r--tests/ui/nll/issue-73159-rpit-static.stderr5
-rw-r--r--tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr6
-rw-r--r--tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr40
-rw-r--r--tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.nll.stderr6
-rw-r--r--tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.polonius.stderr6
-rw-r--r--tests/ui/nll/ty-outlives/impl-trait-captures.stderr6
-rw-r--r--tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr6
-rw-r--r--tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr6
-rw-r--r--tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr6
-rw-r--r--tests/ui/type-alias-impl-trait/different_args_considered_equal2.stderr5
-rw-r--r--tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr6
30 files changed, 124 insertions, 186 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs
index 3cee8ff5f4c..877a8a23d7f 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs
@@ -17,8 +17,8 @@ use rustc_span::{BytePos, ErrorGuaranteed, Span, Symbol};
 use rustc_type_ir::Upcast as _;
 
 use super::nice_region_error::find_anon_type;
-use super::{nice_region_error, ObligationCauseAsDiagArg};
-use crate::error_reporting::infer::ObligationCauseExt as _;
+use super::ObligationCauseAsDiagArg;
+use crate::error_reporting::infer::ObligationCauseExt;
 use crate::error_reporting::TypeErrCtxt;
 use crate::errors::{
     self, note_and_explain, FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound,
@@ -1212,22 +1212,8 @@ pub fn unexpected_hidden_region_diagnostic<'a, 'tcx>(
                 hidden_region,
                 "",
             );
-            if let Some(reg_info) = tcx.is_suitable_region(generic_param_scope, hidden_region) {
-                if infcx.tcx.features().precise_capturing {
-                    suggest_precise_capturing(tcx, opaque_ty_key.def_id, hidden_region, &mut err);
-                } else {
-                    let fn_returns = tcx.return_type_impl_or_dyn_traits(reg_info.def_id);
-                    nice_region_error::suggest_new_region_bound(
-                        tcx,
-                        &mut err,
-                        fn_returns,
-                        hidden_region.to_string(),
-                        None,
-                        format!("captures `{hidden_region}`"),
-                        None,
-                        Some(reg_info.def_id),
-                    )
-                }
+            if let Some(_) = tcx.is_suitable_region(generic_param_scope, hidden_region) {
+                suggest_precise_capturing(tcx, opaque_ty_key.def_id, hidden_region, &mut err);
             }
         }
         ty::RePlaceholder(_) => {
diff --git a/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr b/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
index 5ae1d78a92b..167b5ee4425 100644
--- a/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
+++ b/tests/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
@@ -26,10 +26,10 @@ LL | |     (a, b)
 LL | | }
    | |_^
    |
-help: to declare that `impl Trait<'a>` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
-   |                                                                                ++++
+LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + use<'a, 'b> {
+   |                                                                                +++++++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/borrowck/alias-liveness/opaque-type-param.stderr b/tests/ui/borrowck/alias-liveness/opaque-type-param.stderr
index 73de5864953..1a32d120057 100644
--- a/tests/ui/borrowck/alias-liveness/opaque-type-param.stderr
+++ b/tests/ui/borrowck/alias-liveness/opaque-type-param.stderr
@@ -7,6 +7,11 @@ LL | fn foo<'a>(s: &'a str) -> impl Trait + 'static {
    |        hidden type `impl Trait + 'static` captures the lifetime `'a` as defined here
 LL |     bar(s)
    |     ^^^^^^
+   |
+help: add a `use<...>` bound to explicitly capture `'a`
+   |
+LL | fn foo<'a>(s: &'a str) -> impl Trait + 'static + use<'a> {
+   |                                                +++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr
index 7a9572d000d..24f3ed7cdf1 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr
@@ -30,10 +30,10 @@ LL |     fn a(&self) -> impl Iterator {
 LL |         self.0.iter_mut()
    |         ^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL |     fn a(&self) -> impl Iterator + '_ {
-   |                                  ++++
+LL |     fn a(&self) -> impl Iterator + use<'_> {
+   |                                  +++++++++
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr b/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
index 173e3dc02cc..d0b18df6a5e 100644
--- a/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
+++ b/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
@@ -8,10 +8,10 @@ LL | fn foo(x: &Vec<i32>) -> impl Sized {
 LL |     x
    |     ^
    |
-help: to declare that `impl Sized` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL | fn foo(x: &Vec<i32>) -> impl Sized + '_ {
-   |                                    ++++
+LL | fn foo(x: &Vec<i32>) -> impl Sized + use<'_> {
+   |                                    +++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr b/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
index 825682c52f9..a2d00edbb6d 100644
--- a/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
+++ b/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
@@ -8,10 +8,10 @@ LL | fn step2<'a, 'b: 'a>() -> impl Sized + 'a {
 LL |     step1::<'a, 'b>()
    |     ^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Sized + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | fn step2<'a, 'b: 'a>() -> impl Sized + 'a + 'b {
-   |                                           ++++
+LL | fn step2<'a, 'b: 'a>() -> impl Sized + 'a + use<'a, 'b> {
+   |                                           +++++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.stderr b/tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.stderr
index b87e31acc12..a1e92e53384 100644
--- a/tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.stderr
+++ b/tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.stderr
@@ -8,10 +8,10 @@ LL | fn hide<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
 LL |     x
    |     ^
    |
-help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | fn hide<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {
-   |                                                                          ++++
+LL | fn hide<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + use<'a, 'b, T> {
+   |                                                                          ++++++++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/hidden-lifetimes.stderr b/tests/ui/impl-trait/hidden-lifetimes.stderr
index bc8f559fdee..70d8c816ecb 100644
--- a/tests/ui/impl-trait/hidden-lifetimes.stderr
+++ b/tests/ui/impl-trait/hidden-lifetimes.stderr
@@ -8,10 +8,10 @@ LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
 LL |     x
    |     ^
    |
-help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {
-   |                                                                     ++++
+LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + use<'a, 'b, T> {
+   |                                                                     ++++++++++++++++
 
 error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
   --> $DIR/hidden-lifetimes.rs:46:5
@@ -23,10 +23,10 @@ LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl S
 LL |     x
    |     ^
    |
-help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {
-   |                                                                                     ++++
+LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + use<'a, 'b, T> {
+   |                                                                                     ++++++++++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs
index d7b62436d2d..e00214fe8e0 100644
--- a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs
+++ b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs
@@ -1,5 +1,3 @@
-#![feature(precise_capturing)]
-
 use std::future::Future;
 use std::pin::Pin;
 
diff --git a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr
index 92ef66c5504..a8f5bfc94c1 100644
--- a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr
+++ b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr
@@ -1,5 +1,5 @@
 error[E0700]: hidden type for `impl Future<Output = i32>` captures lifetime that does not appear in bounds
-  --> $DIR/cannot-capture-intersection.rs:24:9
+  --> $DIR/cannot-capture-intersection.rs:22:9
    |
 LL |     fn foo<'a, 'b>(&'a self, x: &'b i32) -> impl Future<Output = i32> {
    |                                             ------------------------- opaque type defined here
diff --git a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr
index 273f51ddbe3..f620bf6dc38 100644
--- a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr
+++ b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr
@@ -7,10 +7,10 @@ LL | fn elided(x: &i32) -> impl Copy { x }
    |              |        opaque type defined here
    |              hidden type `&i32` captures the anonymous lifetime defined here
    |
-help: to declare that `impl Copy` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL | fn elided(x: &i32) -> impl Copy + '_ { x }
-   |                                 ++++
+LL | fn elided(x: &i32) -> impl Copy + use<'_> { x }
+   |                                 +++++++++
 
 error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
   --> $DIR/must_outlive_least_region_or_bound.rs:6:44
@@ -21,10 +21,10 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
    |             |                  opaque type defined here
    |             hidden type `&'a i32` captures the lifetime `'a` as defined here
    |
-help: to declare that `impl Copy` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
-   |                                          ++++
+LL | fn explicit<'a>(x: &'a i32) -> impl Copy + use<'a> { x }
+   |                                          +++++++++
 
 error: lifetime may not live long enough
   --> $DIR/must_outlive_least_region_or_bound.rs:9:46
@@ -108,10 +108,10 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
 LL |     move |_| println!("{}", y)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Fn(&'a u32)` captures `'b`, you can add an explicit `'b` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'b`
    |
-LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {
-   |                                                                              ++++
+LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + use<'a, 'b> {
+   |                                                                              +++++++++++++
 
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/must_outlive_least_region_or_bound.rs:47:5
diff --git a/tests/ui/impl-trait/nested-return-type4.stderr b/tests/ui/impl-trait/nested-return-type4.stderr
index f1e3b97be02..407800eff18 100644
--- a/tests/ui/impl-trait/nested-return-type4.stderr
+++ b/tests/ui/impl-trait/nested-return-type4.stderr
@@ -8,14 +8,10 @@ LL | fn test<'s: 's>(s: &'s str) -> impl std::future::Future<Output = impl Sized
 LL |     async move { let _s = s; }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Future<Output = impl Sized>` captures `'s`, you can add an explicit `'s` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'s`
    |
-LL | fn test<'s: 's>(s: &'s str) -> impl std::future::Future<Output = impl Sized> + 's {
-   |                                                                              ++++
-help: to declare that `impl Sized` captures `'s`, you can add an explicit `'s` lifetime bound
-   |
-LL | fn test<'s: 's>(s: &'s str) -> impl std::future::Future<Output = impl Sized + 's> {
-   |                                                                             ++++
+LL | fn test<'s: 's>(s: &'s str) -> impl std::future::Future<Output = impl Sized> + use<'s> {
+   |                                                                              +++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.rs b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.rs
index b50780643f1..d34c6135596 100644
--- a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.rs
+++ b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.rs
@@ -1,5 +1,3 @@
-#![feature(precise_capturing)]
-
 fn lifetime<'a, 'b>(x: &'a ()) -> impl Sized + use<'b> {
 //~^ HELP add `'a` to the `use<...>` bound
     x
diff --git a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr
index 1007a835894..b0c4cc2fea0 100644
--- a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr
+++ b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr
@@ -1,5 +1,5 @@
 error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:5:5
+  --> $DIR/hidden-type-suggestion.rs:3:5
    |
 LL | fn lifetime<'a, 'b>(x: &'a ()) -> impl Sized + use<'b> {
    |             --                    -------------------- opaque type defined here
@@ -15,7 +15,7 @@ LL | fn lifetime<'a, 'b>(x: &'a ()) -> impl Sized + use<'b, 'a> {
    |                                                      ++++
 
 error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:11:5
+  --> $DIR/hidden-type-suggestion.rs:9:5
    |
 LL | fn param<'a, T>(x: &'a ()) -> impl Sized + use<T> {
    |          --                   ------------------- opaque type defined here
@@ -31,7 +31,7 @@ LL | fn param<'a, T>(x: &'a ()) -> impl Sized + use<'a, T> {
    |                                                +++
 
 error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:17:5
+  --> $DIR/hidden-type-suggestion.rs:15:5
    |
 LL | fn empty<'a>(x: &'a ()) -> impl Sized + use<> {
    |          --                ------------------ opaque type defined here
@@ -47,7 +47,7 @@ LL | fn empty<'a>(x: &'a ()) -> impl Sized + use<'a> {
    |                                             ++
 
 error[E0700]: hidden type for `impl Captures<'captured>` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:26:5
+  --> $DIR/hidden-type-suggestion.rs:24:5
    |
 LL | fn missing<'a, 'captured, 'not_captured, Captured>(x: &'a ()) -> impl Captures<'captured> {
    |            --                                                    ------------------------ opaque type defined here
@@ -63,7 +63,7 @@ LL | fn missing<'a, 'captured, 'not_captured, Captured>(x: &'a ()) -> impl Captu
    |                                                                                           ++++++++++++++++++++++++++++++
 
 error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:32:5
+  --> $DIR/hidden-type-suggestion.rs:30:5
    |
 LL | fn no_params_yet(_: impl Sized, y: &()) -> impl Sized {
    |                                    ---     ---------- opaque type defined here
@@ -74,7 +74,7 @@ LL |     y
    |     ^
    |
 note: you could use a `use<...>` bound to explicitly capture `'_`, but argument-position `impl Trait`s are not nameable
-  --> $DIR/hidden-type-suggestion.rs:30:21
+  --> $DIR/hidden-type-suggestion.rs:28:21
    |
 LL | fn no_params_yet(_: impl Sized, y: &()) -> impl Sized {
    |                     ^^^^^^^^^^
@@ -84,7 +84,7 @@ LL | fn no_params_yet<T: Sized>(_: T, y: &()) -> impl Sized + use<'_, T> {
    |                 ++++++++++    ~                        ++++++++++++
 
 error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
-  --> $DIR/hidden-type-suggestion.rs:38:5
+  --> $DIR/hidden-type-suggestion.rs:36:5
    |
 LL | fn yes_params_yet<'a, T>(_: impl Sized, y: &'a ()) -> impl Sized {
    |                   --                                  ---------- opaque type defined here
@@ -95,7 +95,7 @@ LL |     y
    |     ^
    |
 note: you could use a `use<...>` bound to explicitly capture `'a`, but argument-position `impl Trait`s are not nameable
-  --> $DIR/hidden-type-suggestion.rs:36:29
+  --> $DIR/hidden-type-suggestion.rs:34:29
    |
 LL | fn yes_params_yet<'a, T>(_: impl Sized, y: &'a ()) -> impl Sized {
    |                             ^^^^^^^^^^
diff --git a/tests/ui/impl-trait/region-escape-via-bound.stderr b/tests/ui/impl-trait/region-escape-via-bound.stderr
index 43f0eeeb558..0518231cfe9 100644
--- a/tests/ui/impl-trait/region-escape-via-bound.stderr
+++ b/tests/ui/impl-trait/region-escape-via-bound.stderr
@@ -9,10 +9,10 @@ LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y>
 LL |     x
    |     ^
    |
-help: to declare that `impl Trait<'y>` captures `'x`, you can add an explicit `'x` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'x`
    |
-LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
-   |                                                    ++++
+LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + use<'y, 'x>
+   |                                                    +++++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/static-return-lifetime-infered.stderr b/tests/ui/impl-trait/static-return-lifetime-infered.stderr
index 4be244068d2..21e3187d019 100644
--- a/tests/ui/impl-trait/static-return-lifetime-infered.stderr
+++ b/tests/ui/impl-trait/static-return-lifetime-infered.stderr
@@ -8,10 +8,10 @@ LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
 LL |         self.x.iter().map(|a| a.0)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator<Item = u32>` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
-   |                                                           ++++
+LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> + use<'_> {
+   |                                                           +++++++++
 
 error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
   --> $DIR/static-return-lifetime-infered.rs:11:9
@@ -23,10 +23,10 @@ LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
 LL |         self.x.iter().map(|a| a.0)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator<Item = u32>` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
-   |                                                             ++++
+LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + use<'a> {
+   |                                                             +++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/lifetimes/issue-105227.fixed b/tests/ui/lifetimes/issue-105227.fixed
deleted file mode 100644
index ef64e1e6541..00000000000
--- a/tests/ui/lifetimes/issue-105227.fixed
+++ /dev/null
@@ -1,26 +0,0 @@
-// Regression test for issue #105227.
-
-//@ run-rustfix
-#![allow(warnings)]
-fn chars0<'a>(v :(&'a  str, &'a str)) -> impl Iterator<Item = char> + 'a  {
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
-    v.0.chars().chain(v.1.chars())
-    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
-}
-
-fn chars1<'a>(v0 : &'a  str, v1 : &'a str) -> impl Iterator<Item = char> + 'a  {
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
-    v0.chars().chain(v1.chars())
-    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
-}
-
-fn chars2<'b>(v0 : &'b str, v1 : &'b str, v2 : &'b str) ->
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can use the named lifetime parameter `'b`
-    (impl Iterator<Item = char> + 'b , &'b str)
-{
-    (v0.chars().chain(v1.chars()), v2)
-    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
-}
-
-fn main() {
-}
diff --git a/tests/ui/lifetimes/issue-105227.rs b/tests/ui/lifetimes/issue-105227.rs
index f37765ffafa..8a0a49e8f0c 100644
--- a/tests/ui/lifetimes/issue-105227.rs
+++ b/tests/ui/lifetimes/issue-105227.rs
@@ -1,23 +1,23 @@
 // Regression test for issue #105227.
 
-//@ run-rustfix
-#![allow(warnings)]
+// FIXME(precise_capturing): Add rustfix here after dealing w/ elided lifetimes
+
+#![allow(unused)]
+
 fn chars0(v :(& str, &str)) -> impl Iterator<Item = char> {
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
+    //~^ HELP add a `use<...>` bound
     v.0.chars().chain(v.1.chars())
     //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
 }
 
 fn chars1(v0 : & str, v1 : &str) -> impl Iterator<Item = char> {
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
+    //~^ HELP add a `use<...>` bound
     v0.chars().chain(v1.chars())
     //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
 }
 
-fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) ->
-//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can use the named lifetime parameter `'b`
-    (impl Iterator<Item = char>, &'b str)
-{
+fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) -> (impl Iterator<Item = char>, &'b str) {
+    //~^ HELP add a `use<...>` bound
     (v0.chars().chain(v1.chars()), v2)
     //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
 }
diff --git a/tests/ui/lifetimes/issue-105227.stderr b/tests/ui/lifetimes/issue-105227.stderr
index b514db461b4..35c05f28854 100644
--- a/tests/ui/lifetimes/issue-105227.stderr
+++ b/tests/ui/lifetimes/issue-105227.stderr
@@ -1,5 +1,5 @@
 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
-  --> $DIR/issue-105227.rs:7:5
+  --> $DIR/issue-105227.rs:9:5
    |
 LL | fn chars0(v :(& str, &str)) -> impl Iterator<Item = char> {
    |               -----            -------------------------- opaque type defined here
@@ -9,13 +9,13 @@ LL |
 LL |     v.0.chars().chain(v.1.chars())
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL | fn chars0<'a>(v :(&'a  str, &'a str)) -> impl Iterator<Item = char> + 'a  {
-   |          ++++      ++        ++                                     ++++
+LL | fn chars0(v :(& str, &str)) -> impl Iterator<Item = char> + use<'_> {
+   |                                                           +++++++++
 
 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
-  --> $DIR/issue-105227.rs:13:5
+  --> $DIR/issue-105227.rs:15:5
    |
 LL | fn chars1(v0 : & str, v1 : &str) -> impl Iterator<Item = char> {
    |                -----                -------------------------- opaque type defined here
@@ -25,29 +25,26 @@ LL |
 LL |     v0.chars().chain(v1.chars())
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL | fn chars1<'a>(v0 : &'a  str, v1 : &'a str) -> impl Iterator<Item = char> + 'a  {
-   |          ++++       ++             ++                                    ++++
+LL | fn chars1(v0 : & str, v1 : &str) -> impl Iterator<Item = char> + use<'_> {
+   |                                                                +++++++++
 
 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
   --> $DIR/issue-105227.rs:21:5
    |
-LL | fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) ->
-   |                    ---- hidden type `std::iter::Chain<Chars<'_>, Chars<'_>>` captures the anonymous lifetime defined here
+LL | fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) -> (impl Iterator<Item = char>, &'b str) {
+   |                    ----                                  -------------------------- opaque type defined here
+   |                    |
+   |                    hidden type `std::iter::Chain<Chars<'_>, Chars<'_>>` captures the anonymous lifetime defined here
 LL |
-LL |     (impl Iterator<Item = char>, &'b str)
-   |      -------------------------- opaque type defined here
-LL | {
 LL |     (v0.chars().chain(v1.chars()), v2)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl Iterator<Item = char>` captures `'_`, you can use the named lifetime parameter `'b`
-   |
-LL ~ fn chars2<'b>(v0 : &'b str, v1 : &'b str, v2 : &'b str) ->
-LL |
-LL ~     (impl Iterator<Item = char> + 'b , &'b str)
+help: add a `use<...>` bound to explicitly capture `'_`
    |
+LL | fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) -> (impl Iterator<Item = char> + use<'_>, &'b str) {
+   |                                                                                     +++++++++
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/nll/issue-73159-rpit-static.stderr b/tests/ui/nll/issue-73159-rpit-static.stderr
index 472db30fbeb..7c564b84a56 100644
--- a/tests/ui/nll/issue-73159-rpit-static.stderr
+++ b/tests/ui/nll/issue-73159-rpit-static.stderr
@@ -7,6 +7,11 @@ LL |     fn make_it(&self) -> impl Iterator<Item = u8> {
    |                          ------------------------ opaque type defined here
 LL |         self.0.iter().copied()
    |         ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: add a `use<...>` bound to explicitly capture `'a`
+   |
+LL |     fn make_it(&self) -> impl Iterator<Item = u8> + use<'a> {
+   |                                                   +++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr b/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr
index cab75e630a7..911ddd3dc80 100644
--- a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr
+++ b/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr
@@ -37,10 +37,10 @@ LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c>
 LL |     s
    |     ^
    |
-help: to declare that `impl Cap<'b> + Cap<'c>` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + 'a
-   |                                                                    ++++
+LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + use<'b, 'c, 'a>
+   |                                                                    +++++++++++++++++
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr b/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr
index 483b5822b9d..1a0611e715e 100644
--- a/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr
+++ b/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr
@@ -9,14 +9,10 @@ LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl
 LL |     [a]
    |     ^^^
    |
-help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'s`
    |
-LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's
-   |                                                                                                ++++
-help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound
-   |
-LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's>
-   |                                                                                               ++++
+LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + use<'a, 'b, 's>
+   |                                                                                                +++++++++++++++++
 
 error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds
   --> $DIR/nested-impl-trait-fail.rs:17:5
@@ -29,14 +25,10 @@ LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl
 LL |     [a]
    |     ^^^
    |
-help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound
-   |
-LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's
-   |                                                                                                ++++
-help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'s`
    |
-LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's>
-   |                                                                                               ++++
+LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + use<'a, 'b, 's>>
+   |                                                                                               +++++++++++++++++
 
 error[E0700]: hidden type for `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures lifetime that does not appear in bounds
   --> $DIR/nested-impl-trait-fail.rs:28:5
@@ -49,14 +41,10 @@ LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> {
 LL |     [a]
    |     ^^^
    |
-help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'s`
    |
-LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's {
-   |                                                       ++++
-help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound
-   |
-LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> {
-   |                                                      ++++
+LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + use<'a, 'b, 's> {
+   |                                                       +++++++++++++++++
 
 error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds
   --> $DIR/nested-impl-trait-fail.rs:28:5
@@ -69,14 +57,10 @@ LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> {
 LL |     [a]
    |     ^^^
    |
-help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound
-   |
-LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's {
-   |                                                       ++++
-help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'s`
    |
-LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> {
-   |                                                      ++++
+LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + use<'a, 'b, 's>> {
+   |                                                      +++++++++++++++++
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.nll.stderr b/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.nll.stderr
index 6f9b3303163..cdf394505a2 100644
--- a/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.nll.stderr
+++ b/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.nll.stderr
@@ -25,10 +25,10 @@ LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne {
 LL |     <&mut i32 as Callable>::call(y)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl PlusOne` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + 'a {
-   |                                             ++++
+LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + use<'a> {
+   |                                             +++++++++
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.polonius.stderr b/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.polonius.stderr
index 6f9b3303163..cdf394505a2 100644
--- a/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.polonius.stderr
+++ b/tests/ui/nll/polonius/location-insensitive-scopes-issue-116657.polonius.stderr
@@ -25,10 +25,10 @@ LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne {
 LL |     <&mut i32 as Callable>::call(y)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl PlusOne` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + 'a {
-   |                                             ++++
+LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + use<'a> {
+   |                                             +++++++++
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
index 48569d1446d..3ceefbc4066 100644
--- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
+++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
@@ -8,10 +8,10 @@ LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
 LL |     x
    |     ^
    |
-help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), ['a/#0, T, 'a/#2])` captures `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound
+help: add a `use<...>` bound to explicitly capture `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`
    |
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) {
-   |                                      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + use<'a, ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)), T> {
+   |                                      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
index e04ec8bb3bc..216b7053488 100644
--- a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
+++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
@@ -7,10 +7,10 @@ LL |     async fn f(self: Pin<&Self>) -> impl Clone { self }
    |                          |          opaque type defined here
    |                          hidden type `Pin<&Foo>` captures the anonymous lifetime defined here
    |
-help: to declare that `impl Clone` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL |     async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
-   |                                                ++++
+LL |     async fn f(self: Pin<&Self>) -> impl Clone + use<'_> { self }
+   |                                                +++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
index a2964881d58..7a2ce110a38 100644
--- a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
+++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
@@ -7,10 +7,10 @@ LL |     fn f(self: Pin<&Self>) -> impl Clone { self }
    |                    |          opaque type defined here
    |                    hidden type `Pin<&Foo>` captures the anonymous lifetime defined here
    |
-help: to declare that `impl Clone` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL |     fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
-   |                                          ++++
+LL |     fn f(self: Pin<&Self>) -> impl Clone + use<'_> { self }
+   |                                          +++++++++
 
 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 64af17c830e..88a18e9d06d 100644
--- a/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
+++ b/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
@@ -20,10 +20,10 @@ LL | |         *dest = g.get();
 LL | |     }
    | |_____^
    |
-help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'_`
    |
-LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
-   |                                                   ++++
+LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + use<'_, G, T>
+   |                                                   +++++++++++++++
 
 error[E0311]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:30:5
diff --git a/tests/ui/type-alias-impl-trait/different_args_considered_equal2.stderr b/tests/ui/type-alias-impl-trait/different_args_considered_equal2.stderr
index 1104c2c498a..213272f5f34 100644
--- a/tests/ui/type-alias-impl-trait/different_args_considered_equal2.stderr
+++ b/tests/ui/type-alias-impl-trait/different_args_considered_equal2.stderr
@@ -9,11 +9,6 @@ LL | fn get_one<'a>(a: *mut &'a str) -> impl IntoIterator<Item = Opaque<'a>> {
 ...
 LL |         None::<Opaque<'static>>
    |         ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-help: to declare that `impl IntoIterator<Item = Opaque<'a>>` captures `'a`, you can add an explicit `'a` lifetime bound
-   |
-LL | fn get_one<'a>(a: *mut &'a str) -> impl IntoIterator<Item = Opaque<'a>> + 'a {
-   |                                                                         ++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
index 9bffa94fda1..0bf9dccfad8 100644
--- a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
+++ b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
@@ -8,10 +8,10 @@ LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne {
 LL |     <&'a mut i32 as Callable>::call(y)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-help: to declare that `impl PlusOne` captures `'a`, you can add an explicit `'a` lifetime bound
+help: add a `use<...>` bound to explicitly capture `'a`
    |
-LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + 'a {
-   |                                             ++++
+LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + use<'a> {
+   |                                             +++++++++
 
 error: aborting due to 1 previous error