diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs index 80bdccd4f2c..1176f131107 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -76,7 +76,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { err.span_label( cause.span, &format!( - "...is captured and required to live as long as `'static` here \ + "...is used and required to live as long as `'static` here \ because of an implicit lifetime bound on the {}", match ctxt.assoc_item.container { AssocItemContainer::TraitContainer(id) => @@ -158,7 +158,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { // We try to make the output have fewer overlapping spans if possible. let require_msg = if spans.is_empty() { - "...is captured and required to live as long as `'static` here" + "...is used and required to live as long as `'static` here" } else { "...and is required to live as long as `'static` here" }; @@ -166,7 +166,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { if sup_origin.span().overlaps(return_sp) { sup_origin.span() } else { return_sp }; for span in &spans { - err.span_label(*span, "...is captured here..."); + err.span_label(*span, "...is used here..."); } if spans.iter().any(|sp| sp.overlaps(return_sp) || *sp > return_sp) { diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr index 6f63a2c5fc3..33f1e0f05b2 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr @@ -4,7 +4,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { | ------- this data with lifetime `'a`... LL | bar(foo, x) - | ^^^ - ...is captured and required to live as long as `'static` here + | ^^^ - ...is used and required to live as long as `'static` here error: aborting due to previous error diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr index 628023ad471..609627aaa9e 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr @@ -5,7 +5,7 @@ LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> { | -------- this data with lifetime `'a`... ... LL | bar(foo, x) - | ^^^ - ...is captured and required to live as long as `'static` here + | ^^^ - ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/project-fn-ret-invariant.rs:45:37 diff --git a/src/test/ui/async-await/issues/issue-62097.stderr b/src/test/ui/async-await/issues/issue-62097.stderr index 11fb7c86c3b..e23277543c6 100644 --- a/src/test/ui/async-await/issues/issue-62097.stderr +++ b/src/test/ui/async-await/issues/issue-62097.stderr @@ -4,7 +4,7 @@ error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `' LL | pub async fn run_dummy_fn(&self) { | ^^^^^ this data with an anonymous lifetime `'_`... LL | foo(|| self.bar()).await; - | --- ...is captured and required to live as long as `'static` here + | --- ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by this bound --> $DIR/issue-62097.rs:4:19 diff --git a/src/test/ui/async-await/issues/issue-72312.rs b/src/test/ui/async-await/issues/issue-72312.rs index eb0cc7e6aec..eb7d12e290c 100644 --- a/src/test/ui/async-await/issues/issue-72312.rs +++ b/src/test/ui/async-await/issues/issue-72312.rs @@ -11,7 +11,7 @@ impl Problem { //~^ NOTE this data with an anonymous lifetime `'_` //~| NOTE in this expansion of desugaring of `async` block or function require_static(async move { //~ NOTE ...and is required to live as long as `'static` here - &self; //~ NOTE ...is captured here... + &self; //~ NOTE ...is used here... }); } } diff --git a/src/test/ui/async-await/issues/issue-72312.stderr b/src/test/ui/async-await/issues/issue-72312.stderr index 7a72edd4e53..798f755765c 100644 --- a/src/test/ui/async-await/issues/issue-72312.stderr +++ b/src/test/ui/async-await/issues/issue-72312.stderr @@ -5,7 +5,7 @@ LL | pub async fn start(&self) { | ^^^^^ this data with an anonymous lifetime `'_`... ... LL | &self; - | ----- ...is captured here... + | ----- ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/issue-72312.rs:13:9 diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr index b3bef677d19..2307572cc3f 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr @@ -4,7 +4,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn with_dyn_debug_static<'a>(x: Box) { | ------------------- this data with lifetime `'a`... LL | static_val(x); - | ^ ...is captured here... + | ^ ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/dyn-trait.rs:20:5 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 bf1f93aebd5..de5d3b612c9 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 @@ -28,7 +28,7 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'sta --> $DIR/must_outlive_least_region_or_bound.rs:9:46 | LL | fn elided2(x: &i32) -> impl Copy + 'static { x } - | ---- ^ ...is captured here... + | ---- ^ ...is used here... | | | this data with an anonymous lifetime `'_`... | @@ -50,7 +50,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime --> $DIR/must_outlive_least_region_or_bound.rs:11:55 | LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } - | ------- ^ ...is captured here... + | ------- ^ ...is used here... | | | this data with lifetime `'a`... | @@ -80,7 +80,7 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'sta --> $DIR/must_outlive_least_region_or_bound.rs:24:65 | LL | fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } - | ---- this data with an anonymous lifetime `'_`... ^ ...is captured and required to live as long as `'static` here + | ---- this data with an anonymous lifetime `'_`... ^ ...is used and required to live as long as `'static` here | help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound | @@ -95,7 +95,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime --> $DIR/must_outlive_least_region_or_bound.rs:29:69 | LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } - | ------- this data with lifetime `'a`... ^ ...is captured here... + | ------- this data with lifetime `'a`... ^ ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/must_outlive_least_region_or_bound.rs:29:34 @@ -136,12 +136,12 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'sta --> $DIR/must_outlive_least_region_or_bound.rs:16:50 | LL | fn elided3(x: &i32) -> Box { Box::new(x) } - | ---- ^ ...is captured and required to live as long as `'static` here + | ---- ^ ...is used and required to live as long as `'static` here | | | this data with an anonymous lifetime `'_`... | note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:14:28 + --> $DIR/must_outlive_least_region_or_bound.rs:16:28 | LL | fn elided3(x: &i32) -> Box { Box::new(x) } | ^^^^^^^^^ ----------- because of this returned expression @@ -156,12 +156,12 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime --> $DIR/must_outlive_least_region_or_bound.rs:18:59 | LL | fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } - | ------- ^ ...is captured and required to live as long as `'static` here + | ------- ^ ...is used and required to live as long as `'static` here | | | this data with lifetime `'a`... | note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:16:37 + --> $DIR/must_outlive_least_region_or_bound.rs:18:37 | LL | fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } | ^^^^^^^^^ ----------- because of this returned expression @@ -176,12 +176,12 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'sta --> $DIR/must_outlive_least_region_or_bound.rs:20:60 | LL | fn elided4(x: &i32) -> Box { Box::new(x) } - | ---- ^ ...is captured and required to live as long as `'static` here + | ---- ^ ...is used and required to live as long as `'static` here | | | this data with an anonymous lifetime `'_`... | note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:18:40 + --> $DIR/must_outlive_least_region_or_bound.rs:20:40 | LL | fn elided4(x: &i32) -> Box { Box::new(x) } | ^^^^^^^ ----------- because of this returned expression @@ -200,10 +200,10 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime --> $DIR/must_outlive_least_region_or_bound.rs:22:69 | LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } - | ------- this data with lifetime `'a`... ^ ...is captured and required to live as long as `'static` here + | ------- this data with lifetime `'a`... ^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type - --> $DIR/must_outlive_least_region_or_bound.rs:20:49 + --> $DIR/must_outlive_least_region_or_bound.rs:22:49 | LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } | ^^^^^^^ ----------- because of this returned expression diff --git a/src/test/ui/issues/issue-16922.stderr b/src/test/ui/issues/issue-16922.stderr index ff7b3b67140..53405a660f8 100644 --- a/src/test/ui/issues/issue-16922.stderr +++ b/src/test/ui/issues/issue-16922.stderr @@ -4,7 +4,7 @@ error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a ` LL | fn foo(value: &T) -> Box { | -- this data with an anonymous lifetime `'_`... LL | Box::new(value) as Box - | ^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^ ...is used and required to live as long as `'static` here | help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound | diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr index 1931934a211..4a6378b84f1 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr @@ -4,7 +4,7 @@ error[E0759]: `fn` parameter has lifetime `'a` but it needs to satisfy a `'stati LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | ------- this data with lifetime `'a`... LL | >::C - | ^^^^^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^^^^^ ...is used and required to live as long as `'static` here error: aborting due to previous error diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr index 0308ecf8f64..1708700f77a 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr @@ -5,7 +5,7 @@ LL | fn load(ss: &mut SomeStruct) -> Box { | --------------- this data with an anonymous lifetime `'_`... ... LL | ss.r - | ^^^^ ...is captured and required to live as long as `'static` here + | ^^^^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/object-lifetime-default-from-box-error.rs:14:37 diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr index 74683f1439a..d8932c067ac 100644 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr +++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr @@ -4,7 +4,7 @@ error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'sta LL | fn a(v: &[u8]) -> Box { | ----- this data with an anonymous lifetime `'_`... LL | let x: Box = Box::new(v); - | ^ ...is captured and required to live as long as `'static` here + | ^ ...is used and required to live as long as `'static` here | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` | @@ -21,7 +21,7 @@ error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'sta LL | fn b(v: &[u8]) -> Box { | ----- this data with an anonymous lifetime `'_`... LL | Box::new(v) - | ^ ...is captured and required to live as long as `'static` here + | ^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/region-object-lifetime-in-coercion.rs:12:33 @@ -46,7 +46,7 @@ LL | fn c(v: &[u8]) -> Box { | ----- this data with an anonymous lifetime `'_`... ... LL | Box::new(v) - | ^ ...is captured and required to live as long as `'static` here + | ^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/region-object-lifetime-in-coercion.rs:16:23 diff --git a/src/test/ui/regions/regions-addr-of-self.stderr b/src/test/ui/regions/regions-addr-of-self.stderr index 738691fd695..3453c6458f1 100644 --- a/src/test/ui/regions/regions-addr-of-self.stderr +++ b/src/test/ui/regions/regions-addr-of-self.stderr @@ -4,7 +4,7 @@ error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `' LL | pub fn chase_cat(&mut self) { | --------- this data with an anonymous lifetime `'_`... LL | let p: &'static mut usize = &mut self.cats_chased; - | ^^^^^^^^^^^^^^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here error: aborting due to previous error diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr index c914d91306c..4153f4f29bc 100644 --- a/src/test/ui/regions/regions-close-object-into-object-2.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr @@ -4,7 +4,7 @@ error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { | ------------------ this data with lifetime `'a`... LL | Box::new(B(&*v)) as Box - | ^^^ ...is captured and required to live as long as `'static` here + | ^^^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/regions-close-object-into-object-2.rs:8:60 diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr index 1f68db023a9..2ea4b431b38 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr @@ -4,7 +4,7 @@ error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn i<'a, T, U>(v: Box+'a>) -> Box { | ---------------- this data with lifetime `'a`... LL | Box::new(B(&*v)) as Box - | ^^^ ...is captured and required to live as long as `'static` here + | ^^^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/regions-close-object-into-object-4.rs:8:52 diff --git a/src/test/ui/regions/regions-proc-bound-capture.stderr b/src/test/ui/regions/regions-proc-bound-capture.stderr index 99657632035..2ebe874da93 100644 --- a/src/test/ui/regions/regions-proc-bound-capture.stderr +++ b/src/test/ui/regions/regions-proc-bound-capture.stderr @@ -5,7 +5,7 @@ LL | fn static_proc(x: &isize) -> Box (isize) + 'static> { | ------ this data with an anonymous lifetime `'_`... LL | // This is illegal, because the region bound on `proc` is 'static. LL | Box::new(move || { *x }) - | ^^^^^^^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/regions-proc-bound-capture.rs:7:59 diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr index 2961d8d7eac..63d291ed7cd 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr @@ -22,7 +22,7 @@ error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an impli LL | fn use_it<'a>(val: Box + 'a>) -> &'a () { | -------------------------------------- this data with lifetime `'a`... LL | val.use_self() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^ ...is used and required to live as long as `'static` here | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:60:30 diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr index 6d9f0811b27..55a1bbf18ab 100644 --- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr +++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr @@ -4,7 +4,7 @@ error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifeti LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { | ---------------------- this data with lifetime `'a`... LL | val.use_self::() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^ ...is used and required to live as long as `'static` here | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:14:32 @@ -24,7 +24,7 @@ error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an impli LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { | ------------------- this data with lifetime `'a`... LL | val.use_self() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl` + | ^^^^^^^^ ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl` | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:64:14 @@ -44,7 +44,7 @@ error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifeti LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { | ------------------- this data with lifetime `'a`... LL | val.use_self() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^ ...is used and required to live as long as `'static` here | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:85:26 @@ -69,7 +69,7 @@ error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifeti LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { | ------------------- this data with lifetime `'a`... LL | MyTrait::use_self(val) - | ^^^ ...is captured here... + | ^^^ ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:9 @@ -95,7 +95,7 @@ error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an impli LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { | ------------------- this data with lifetime `'a`... LL | val.use_self() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^ ...is used and required to live as long as `'static` here | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:31:26 @@ -115,7 +115,7 @@ error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an impli LL | fn use_it<'a>(val: &'a Box) -> &'a () { | ----------------------------- this data with lifetime `'a`... LL | val.use_self() - | ^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^ ...is used and required to live as long as `'static` here | note: the used `impl` has a `'static` requirement --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:48:30 diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr index 1ca22ebeef4..a5b50634c71 100644 --- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr +++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr @@ -7,7 +7,7 @@ LL | fn iter(&self) -> impl Iterator> { LL | remaining: self.0.iter(), | ------ ^^^^ | | - | ...is captured here... + | ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/trait-object-nested-in-impl-trait.rs:27:23 @@ -32,7 +32,7 @@ LL | fn iter(&self) -> impl Iterator> + '_ { LL | remaining: self.0.iter(), | ------ ^^^^ | | - | ...is captured here... + | ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/trait-object-nested-in-impl-trait.rs:38:23 @@ -53,7 +53,7 @@ LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { LL | remaining: self.0.iter(), | ------ ^^^^ | | - | ...is captured here... + | ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/trait-object-nested-in-impl-trait.rs:49:30 @@ -74,7 +74,7 @@ LL | fn iter<'a>(&'a self) -> impl Iterator> { LL | remaining: self.0.iter(), | ------ ^^^^ | | - | ...is captured here... + | ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/trait-object-nested-in-impl-trait.rs:60:30 diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr index 42230ddd695..d4bb9350b0b 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr @@ -36,10 +36,10 @@ LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { LL | let y = x as &dyn Bar<'_, '_>; | - ^^ | | - | ...is captured here... + | ...is used here... LL | LL | y.get_b() // ERROR - | - ...is captured here... + | - ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/type-checking-test-4.rs:29:5 @@ -61,7 +61,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | ------------ this data with lifetime `'a`... LL | <_ as Bar>::get_b(x) // ERROR - | ^^^^^^^^^^^^^^^^^ ...is captured and required to live as long as `'static` here + | ^^^^^^^^^^^^^^^^^ ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/type-checking-test-4.rs:32:48 @@ -77,7 +77,7 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { | ------------ this data with lifetime `'a`... LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR - | ----------^^------------- ...is captured and required to live as long as `'static` here + | ----------^^------------- ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/type-checking-test-4.rs:37:48 @@ -95,13 +95,13 @@ LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> { LL | let y = x as &dyn Bar<'_, '_>; | - ^^ | | - | ...is captured here... + | ...is used here... LL | LL | y.get_b(); // ERROR - | - ...is captured here... + | - ...is used here... LL | let z = y; LL | z.get_b() // ERROR - | - ...is captured here... + | - ...is used here... | note: ...and is required to live as long as `'static` here --> $DIR/type-checking-test-4.rs:47:5 diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr index b8552c872c1..f4285a0f98e 100644 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr +++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr @@ -7,7 +7,7 @@ LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to LL | Box::new(items.iter()) | ----- ^^^^ | | - | ...is captured and required to live as long as `'static` here + | ...is used and required to live as long as `'static` here | note: `'static` lifetime requirement introduced by the return type --> $DIR/dyn-trait-underscore.rs:6:29