From 03bbb98019fc447c4afd71d03f6990dcc0c7f160 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 14 Mar 2022 15:56:37 +0100 Subject: [PATCH] Bless tests. --- src/test/ui/async-await/issue-86507.stderr | 6 +-- .../builtin-superkinds-self-type.stderr | 9 ++-- ...-infer_static_outlives_requirements.stderr | 6 ++- .../issue-86483.stderr | 16 +++--- .../issue-91139.migrate.stderr | 7 ++- .../issue-92096.migrate.stderr | 18 ++++--- .../missing-bounds.stderr | 6 +-- .../unsatified-item-lifetime-bound.stderr | 2 +- .../impl-trait/equal-hidden-lifetimes.stderr | 2 +- .../must_outlive_least_region_or_bound.stderr | 9 ++-- .../type_parameters_captured.stderr | 9 ++-- src/test/ui/issues/issue-30438-c.rs | 1 + src/test/ui/issues/issue-30438-c.stderr | 12 ++++- .../lifetime-doesnt-live-long-enough.stderr | 39 +++++++++----- .../use_of_moved_value_copy_suggestions.fixed | 18 +++---- .../use_of_moved_value_copy_suggestions.rs | 6 +-- ...use_of_moved_value_copy_suggestions.stderr | 20 +++---- .../propagate-from-trait-match.stderr | 8 +-- .../ty-outlives/impl-trait-outlives.stderr | 16 +++--- .../projection-implied-bounds.stderr | 7 ++- .../projection-one-region-closure.stderr | 16 +++--- .../projection-where-clause-none.stderr | 8 +-- ...ram-closure-approximate-lower-bound.stderr | 7 ++- ...m-closure-outlives-from-return-type.stderr | 16 +++--- ...-closure-outlives-from-where-clause.stderr | 15 ++++-- .../nll/ty-outlives/ty-param-fn-body.stderr | 7 ++- .../ui/nll/ty-outlives/ty-param-fn.stderr | 16 +++--- ...ions-close-object-into-object-4.nll.stderr | 28 +++++++--- ...ons-close-object-into-object-5.base.stderr | 53 +++++++++++-------- ...ions-close-object-into-object-5.nll.stderr | 32 ++++++----- ...ns-close-over-type-parameter-1.base.stderr | 14 +++-- ...ons-close-over-type-parameter-1.nll.stderr | 14 +++-- ...egions-close-param-into-object.base.stderr | 32 ++++++----- ...regions-close-param-into-object.nll.stderr | 32 ++++++----- ...on-outlives-static-outlives-free-region.rs | 2 +- ...utlives-static-outlives-free-region.stderr | 6 +-- ...mplied-bounds-projection-gap-1.base.stderr | 8 +-- ...implied-bounds-projection-gap-1.nll.stderr | 8 +-- ...regions-infer-bound-from-trait.base.stderr | 12 +++-- .../regions-infer-bound-from-trait.nll.stderr | 14 +++-- .../ui/regions/regions-static-bound-rpass.rs | 7 +++ .../regions/regions-static-bound-rpass.stderr | 18 +++---- .../regions/regions-static-bound.base.stderr | 30 ++++++++--- .../regions/regions-static-bound.nll.stderr | 24 +++++++-- src/test/ui/regions/regions-static-bound.rs | 4 ++ .../dont-infer-static.stderr | 6 ++- .../regions-enum-not-wf.stderr | 22 +++++--- .../regions-struct-not-wf.stderr | 13 +++-- .../ui/static/static-lifetime-bound.stderr | 2 +- .../ui/suggestions/bound-suggestions.fixed | 2 +- .../ui/suggestions/bound-suggestions.stderr | 6 +-- ...it-with-missing-trait-bounds-in-arg.stderr | 2 +- src/test/ui/suggestions/issue-21673.stderr | 6 +-- .../missing-lifetimes-in-signature-2.stderr | 6 ++- .../missing-lifetimes-in-signature.stderr | 24 +++++---- .../suggestions/restrict-type-argument.stderr | 4 +- .../suggest-impl-trait-lifetime.stderr | 7 +-- ...e-65284-suggest-generic-trait-bound.stderr | 4 +- src/test/ui/traits/issue-95898.stderr | 4 +- .../bounds-are-checked.stderr | 2 +- ...type_does_not_live_long_enough.base.stderr | 7 ++- ..._type_does_not_live_long_enough.nll.stderr | 7 ++- .../wf/wf-impl-associated-type-region.stderr | 7 ++- src/test/ui/wf/wf-in-fn-type-static.stderr | 16 +++--- src/test/ui/wf/wf-in-obj-type-static.stderr | 8 +-- .../wf/wf-outlives-ty-in-fn-or-trait.stderr | 14 +++-- .../tests/ui/extra_unused_lifetimes.stderr | 8 +-- .../clippy/tests/ui/needless_lifetimes.stderr | 8 +-- 68 files changed, 527 insertions(+), 298 deletions(-) diff --git a/src/test/ui/async-await/issue-86507.stderr b/src/test/ui/async-await/issue-86507.stderr index ad0a3592241..5bbc20359c6 100644 --- a/src/test/ui/async-await/issue-86507.stderr +++ b/src/test/ui/async-await/issue-86507.stderr @@ -14,10 +14,10 @@ note: captured value is not `Send` because `&` references cannot be sent unless LL | let x = x; | ^ has type `&T` which is not `Send`, because `T` is not `Sync` = note: required for the cast to the object type `dyn Future + Send` -help: consider further restricting type parameter `T` +help: consider further restricting this bound | -LL | where 'me:'async_trait, T: std::marker::Sync { - | ++++++++++++++++++++++ +LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T) + | +++++++++++++++++++ error: aborting due to previous error 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 2dac4a22ae7..b1e59e9d5de 100644 --- a/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr @@ -2,9 +2,12 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/builtin-superkinds-self-type.rs:10:16 | LL | impl Foo for T { } - | -- ^^^ ...so that the type `T` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `T: 'static +` + | ^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | impl Foo for T { } + | +++++++++ error: aborting due to previous error 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 2bccec45894..7ffebab4153 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 @@ -1,8 +1,6 @@ error[E0310]: the parameter type `U` may not live long enough --> $DIR/feature-gate-infer_static_outlives_requirements.rs:5:10 | -LL | struct Foo { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | bar: Bar | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds... | @@ -11,6 +9,10 @@ note: ...that is required by this bound | LL | struct Bar { | ^^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | struct Foo { + | +++++++++ error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-86483.stderr b/src/test/ui/generic-associated-types/issue-86483.stderr index 2f29cd5d9e9..a13dc043dc5 100644 --- a/src/test/ui/generic-associated-types/issue-86483.stderr +++ b/src/test/ui/generic-associated-types/issue-86483.stderr @@ -1,10 +1,7 @@ error[E0311]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:5:1 | -LL | pub trait IceIce - | ^ - help: consider adding an explicit lifetime bound...: `T: 'a` - | _| - | | +LL | / pub trait IceIce LL | | where LL | | for<'a> T: 'a, LL | | { @@ -19,13 +16,14 @@ note: ...that is required by this bound | LL | for<'a> T: 'a, | ^^ +help: consider adding an explicit lifetime bound... + | +LL | for<'a> T: 'a + 'a, + | ++++ error[E0311]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:9:5 | -LL | pub trait IceIce - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | type Ice<'v>: IntoIterator; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... | @@ -34,6 +32,10 @@ note: ...that is required by this bound | LL | for<'a> T: 'a, | ^^ +help: consider adding an explicit lifetime bound... + | +LL | for<'a> T: 'a + 'a, + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:9:32 diff --git a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr index a27d8110238..b424d9a2fdb 100644 --- a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr +++ b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr @@ -1,10 +1,13 @@ error[E0311]: the parameter type `T` may not live long enough --> $DIR/issue-91139.rs:27:12 | -LL | fn foo() { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | let _: for<'a> fn(<() as Foo>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn foo() { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr index 72ade5774d7..c74161cd3e0 100644 --- a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr +++ b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr @@ -2,17 +2,23 @@ error[E0311]: the parameter type `C` may not live long enough --> $DIR/issue-92096.rs:20:33 | LL | fn call_connect(c: &'_ C) -> impl '_ + Future + Send - | - ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `C: 'a` + | ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | C: Client + Send + Sync + 'a, + | ++++ error[E0311]: the parameter type `C` may not live long enough --> $DIR/issue-92096.rs:20:33 | LL | fn call_connect(c: &'_ C) -> impl '_ + Future + Send - | - ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `C: 'a` + | ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | C: Client + Send + Sync + 'a, + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr index aaeec920527..5323ee17226 100644 --- a/src/test/ui/generic-associated-types/missing-bounds.stderr +++ b/src/test/ui/generic-associated-types/missing-bounds.stderr @@ -87,10 +87,10 @@ note: tuple struct defined here | LL | struct E(B); | ^ -help: consider further restricting type parameter `B` +help: consider further restricting this bound | -LL | impl Add for E where ::Output = B, B: Add { - | ++++++++++++++++++++ +LL | impl> Add for E where ::Output = B { + | +++++++++++++++++ error: aborting due to 5 previous errors diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr index 4f0a023ee39..ae52010cc50 100644 --- a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr +++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr @@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a` --> $DIR/unsatified-item-lifetime-bound.rs:4:12 | LL | type Y<'a: 'static>; - | ^^^^^^^^^^^ + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` diff --git a/src/test/ui/impl-trait/equal-hidden-lifetimes.stderr b/src/test/ui/impl-trait/equal-hidden-lifetimes.stderr index 51247f1d7b0..3e48aef553b 100644 --- a/src/test/ui/impl-trait/equal-hidden-lifetimes.stderr +++ b/src/test/ui/impl-trait/equal-hidden-lifetimes.stderr @@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a` --> $DIR/equal-hidden-lifetimes.rs:7:25 | LL | fn equal_regions_static<'a: 'static>(x: &'a i32) -> impl Sized { - | ^^^^^^^^^^^ + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` 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 6bcfb27ce16..dade2b91fe0 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 @@ -128,9 +128,12 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:38:51 | LL | fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { - | -- ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `T: 'static +` + | ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { + | +++++++++ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement --> $DIR/must_outlive_least_region_or_bound.rs:16:50 diff --git a/src/test/ui/impl-trait/type_parameters_captured.stderr b/src/test/ui/impl-trait/type_parameters_captured.stderr index 40e50b9922f..9f28a8d44a7 100644 --- a/src/test/ui/impl-trait/type_parameters_captured.stderr +++ b/src/test/ui/impl-trait/type_parameters_captured.stderr @@ -2,9 +2,12 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/type_parameters_captured.rs:7:20 | LL | fn foo(x: T) -> impl Any + 'static { - | - ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `T: 'static` + | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn foo(x: T) -> impl Any + 'static { + | +++++++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-30438-c.rs b/src/test/ui/issues/issue-30438-c.rs index 813c1d3e2cc..4cf634245be 100644 --- a/src/test/ui/issues/issue-30438-c.rs +++ b/src/test/ui/issues/issue-30438-c.rs @@ -5,6 +5,7 @@ trait Trait { type Out; } struct Test<'a> { s: &'a str } fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { + //~^ WARN unnecessary lifetime parameter `'z` let x = Test { s: "this cannot last" }; &x //~^ ERROR: cannot return reference to local variable `x` diff --git a/src/test/ui/issues/issue-30438-c.stderr b/src/test/ui/issues/issue-30438-c.stderr index 7c001088097..a7a5c0500fd 100644 --- a/src/test/ui/issues/issue-30438-c.stderr +++ b/src/test/ui/issues/issue-30438-c.stderr @@ -1,9 +1,17 @@ +warning: unnecessary lifetime parameter `'z` + --> $DIR/issue-30438-c.rs:7:74 + | +LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'z` + error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-30438-c.rs:9:5 + --> $DIR/issue-30438-c.rs:10:5 | LL | &x | ^^ returns a reference to data owned by the current function -error: aborting due to previous error +error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0515`. 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 e5083e3a088..33f6c498b6f 100644 --- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr +++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr @@ -1,18 +1,24 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:19:10 | -LL | struct Foo { - | - help: consider adding an explicit lifetime bound...: `T: 'static` LL | foo: &'static T | ^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | struct Foo { + | +++++++++ error[E0309]: the parameter type `K` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:24:19 | -LL | trait X: Sized { - | - help: consider adding an explicit lifetime bound...: `K: 'a` LL | fn foo<'a, L: X<&'a Nested>>(); | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | trait X: Sized { + | ++++ error[E0309]: the parameter type `Self` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:19 @@ -27,25 +33,34 @@ error[E0309]: the parameter type `L` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:32:22 | LL | fn baz<'a, L, M: X<&'a Nested>>() { - | - ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested` does not outlive the data it points at - | | - | help: consider adding an explicit lifetime bound...: `L: 'a` + | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | fn baz<'a, L: 'a, M: X<&'a Nested>>() { + | ++++ error[E0309]: the parameter type `K` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33 | -LL | impl Nested { - | - help: consider adding an explicit lifetime bound...: `K: 'a` LL | fn generic_in_parent<'a, L: X<&'a Nested>>() { | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | impl Nested { + | ++++ 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: 'b>() { - | ^^^^^^^^^^^^^^^^ -- help: consider adding an explicit lifetime bound...: `M: 'a +` - | | - | ...so that the reference type `&'a Nested` does not outlive the data it points at + | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | fn generic_in_child<'a, 'b, L: X<&'a Nested>, M: 'b + 'a>() { + | ++++ error: aborting due to 6 previous errors diff --git a/src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed b/src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed index fb6cf7e8996..10cff3a27e4 100644 --- a/src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed +++ b/src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed @@ -54,31 +54,31 @@ where fn duplicate_custom_3(t: S) -> (S, S) where - T: A, - T: B, T: Trait, T: Copy - //~^ HELP consider further restricting type parameter `T` + T: A + Trait + Copy, + //~^ HELP consider further restricting this bound + T: B, { (t, t) //~ use of moved value: `t` } -fn duplicate_custom_4(t: S) -> (S, S) +fn duplicate_custom_4(t: S) -> (S, S) +//~^ HELP consider further restricting this bound where - T: B + Trait + Copy, - //~^ HELP consider further restricting this bound + T: B, { (t, t) //~ use of moved value: `t` } #[rustfmt::skip] -fn existing_colon(t: T) { +fn existing_colon(t: T) { //~^ HELP consider restricting type parameter `T` [t, t]; //~ use of moved value: `t` } fn existing_colon_in_where(t: T) where - T: Copy, - //~^ HELP consider further restricting this bound + T:, T: Copy + //~^ HELP consider further restricting type parameter `T` { [t, t]; //~ use of moved value: `t` } diff --git a/src/test/ui/moves/use_of_moved_value_copy_suggestions.rs b/src/test/ui/moves/use_of_moved_value_copy_suggestions.rs index cadbf2a54cc..0a43dd1a9a3 100644 --- a/src/test/ui/moves/use_of_moved_value_copy_suggestions.rs +++ b/src/test/ui/moves/use_of_moved_value_copy_suggestions.rs @@ -55,16 +55,16 @@ where fn duplicate_custom_3(t: S) -> (S, S) where T: A, + //~^ HELP consider further restricting this bound T: B, - //~^ HELP consider further restricting type parameter `T` { (t, t) //~ use of moved value: `t` } fn duplicate_custom_4(t: S) -> (S, S) +//~^ HELP consider further restricting this bound where T: B, - //~^ HELP consider further restricting this bound { (t, t) //~ use of moved value: `t` } @@ -78,7 +78,7 @@ fn existing_colon(t: T) { fn existing_colon_in_where(t: T) where T:, - //~^ HELP consider further restricting this bound + //~^ HELP consider further restricting type parameter `T` { [t, t]; //~ use of moved value: `t` } diff --git a/src/test/ui/moves/use_of_moved_value_copy_suggestions.stderr b/src/test/ui/moves/use_of_moved_value_copy_suggestions.stderr index f5252084d68..150fa5d92d6 100644 --- a/src/test/ui/moves/use_of_moved_value_copy_suggestions.stderr +++ b/src/test/ui/moves/use_of_moved_value_copy_suggestions.stderr @@ -121,10 +121,10 @@ LL | (t, t) | | | value moved here | -help: consider further restricting type parameter `T` +help: consider further restricting this bound | -LL | T: B, T: Trait, T: Copy - | ~~~~~~~~~~~~~~~~~~~ +LL | T: A + Trait + Copy, + | ++++++++++++++ error[E0382]: use of moved value: `t` --> $DIR/use_of_moved_value_copy_suggestions.rs:69:9 @@ -139,8 +139,8 @@ LL | (t, t) | help: consider further restricting this bound | -LL | T: B + Trait + Copy, - | ++++++++++++++ +LL | fn duplicate_custom_4(t: S) -> (S, S) + | ++++++++++++++ error[E0382]: use of moved value: `t` --> $DIR/use_of_moved_value_copy_suggestions.rs:83:9 @@ -153,10 +153,10 @@ LL | [t, t]; | | | value moved here | -help: consider further restricting this bound +help: consider further restricting type parameter `T` | -LL | T: Copy, - | ++++ +LL | T:, T: Copy + | ~~~~~~~~~ error[E0382]: use of moved value: `t` --> $DIR/use_of_moved_value_copy_suggestions.rs:75:9 @@ -171,8 +171,8 @@ LL | [t, t]; | help: consider restricting type parameter `T` | -LL | fn existing_colon(t: T) { - | ++++ +LL | fn existing_colon(t: T) { + | ++++++ error: aborting due to 11 previous errors diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr index b6856089a84..08605efa2ea 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -36,9 +36,6 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/propagate-from-trait-match.rs:32:36 | -LL | fn supply<'a, T>(value: T) - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | establish_relationships(value, |value| { | ____________________________________^ LL | | @@ -48,6 +45,11 @@ LL | | // This function call requires that LL | | require(value); LL | | }); | |_____^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Trait<'a> + 'a, + | ++++ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr b/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr index 3d4cfc1610a..64b08a9b32f 100644 --- a/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr +++ b/src/test/ui/nll/ty-outlives/impl-trait-outlives.stderr @@ -1,20 +1,24 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/impl-trait-outlives.rs:11:5 | -LL | fn no_region<'a, T>(x: Box) -> impl Debug + 'a - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | x | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Debug + 'a, + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/impl-trait-outlives.rs:26:5 | -LL | fn wrong_region<'a, 'b, T>(x: Box) -> impl Debug + 'a - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | x | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: 'b + Debug + 'a, + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr b/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr index cc5aa1eb11e..3b9b2956c51 100644 --- a/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr +++ b/src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr @@ -1,10 +1,13 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/projection-implied-bounds.rs:30:18 | -LL | fn generic2(value: T) { - | -- help: consider adding an explicit lifetime bound...: `T: 'static +` LL | twice(value, |value_ref, item| invoke2(value_ref, item)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn generic2(value: T) { + | +++++++++ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index 62db6dd845a..caf2e3c4747 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -31,11 +31,13 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-one-region-closure.rs:45:29 | -LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Anything<'b> + 'a, + | ++++ error: lifetime may not live long enough --> $DIR/projection-one-region-closure.rs:45:39 @@ -82,11 +84,13 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-one-region-closure.rs:56:29 | -LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T) - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Anything<'b> + 'a, + | ++++ error: lifetime may not live long enough --> $DIR/projection-one-region-closure.rs:56:39 diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr index c51edb7868d..e28b89580bc 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-none.stderr @@ -1,11 +1,13 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/projection-where-clause-none.rs:16:5 | -LL | fn foo<'a, T>() -> &'a () - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | bar::() | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: MyTrait<'a> + 'a, + | ++++ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index 3e5e4868341..a4588730b3f 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -52,10 +52,13 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24 | -LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn generic_fail<'a, T: 'a>(cell: Cell<&'a ()>, value: T) { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index dc2f23b4fc8..084dd93cb86 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -29,20 +29,24 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23 | -LL | fn no_region<'a, T>(x: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | with_signature(x, |y| y) | ^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Debug + 'a, + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5 | -LL | fn wrong_region<'a, 'b, T>(x: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | x | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: 'b + Debug + 'a, + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index e9f728c77b3..11a737ba291 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -37,8 +37,6 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 | -LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | with_signature(a, b, |x, y| { | __________________________^ LL | | @@ -48,6 +46,11 @@ LL | | // See `correct_region`, which explains the point of this LL | | require(&x, &y) LL | | }) | |_____^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) { + | ++++ note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 @@ -121,9 +124,6 @@ LL | | } error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 | -LL | fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | with_signature(a, b, |x, y| { | __________________________^ LL | | @@ -131,6 +131,11 @@ LL | | // See `correct_region` LL | | require(&x, &y) LL | | }) | |_____^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: 'b + 'a, + | ++++ note: external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr index a2e6a5d57cd..ba79137d18d 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr @@ -1,10 +1,13 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn-body.rs:19:5 | -LL | fn region_static<'a, T>(cell: Cell<&'a usize>, t: T) { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | outlives(cell, t) | ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn region_static<'a, T: 'a>(cell: Cell<&'a usize>, t: T) { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr index fce360dd54b..729f14d84ad 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-fn.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-fn.stderr @@ -1,20 +1,24 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn.rs:11:5 | -LL | fn no_region<'a, T>(x: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | x | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: Debug + 'a, + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/ty-param-fn.rs:26:5 | -LL | fn wrong_region<'a, 'b, T>(x: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | x | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: 'b + Debug + 'a, + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr index 05ddc09b2d0..66d3102225e 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr @@ -1,26 +1,35 @@ error[E0310]: the parameter type `U` may not live long enough --> $DIR/regions-close-object-into-object-4.rs:13:5 | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | Box::new(B(&*v)) as Box | ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { + | +++++++++ error[E0310]: the parameter type `U` may not live long enough --> $DIR/regions-close-object-into-object-4.rs:13:5 | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { + | +++++++++ error[E0310]: the parameter type `U` may not live long enough --> $DIR/regions-close-object-into-object-4.rs:13:5 | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { + | +++++++++ error: lifetime may not live long enough --> $DIR/regions-close-object-into-object-4.rs:13:5 @@ -51,10 +60,13 @@ LL | Box::new(B(&*v)) as Box error[E0310]: the parameter type `U` may not live long enough --> $DIR/regions-close-object-into-object-4.rs:13:14 | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | Box::new(B(&*v)) as Box | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn i<'a, T, U: 'static>(v: Box+'a>) -> Box { + | +++++++++ error: aborting due to 6 previous errors diff --git a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr b/src/test/ui/regions/regions-close-object-into-object-5.base.stderr index 8b5a06bab71..1a78079b638 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.base.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-5.base.stderr @@ -1,9 +1,6 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:5 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... | @@ -12,22 +9,25 @@ note: ...that is required by this bound | LL | struct B<'a, T: 'a>(&'a (A + 'a)); | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:5 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:14 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^ ...so that the type `T` will meet its required lifetime bounds... | @@ -36,13 +36,14 @@ note: ...that is required by this bound | LL | struct B<'a, T: 'a>(&'a (A + 'a)); | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:14 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds... | @@ -51,33 +52,43 @@ note: ...that is required by this bound | LL | struct B<'a, T: 'a>(&'a (A + 'a)); | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:16 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^ ...so that the reference type `&dyn A` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:16 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^ ...so that the type `(dyn A + 'static)` is not borrowed for too long + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:16 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^ ...so that the type `(dyn A + 'static)` is not borrowed for too long + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error: aborting due to 7 previous errors diff --git a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr index f4e3809e916..cb06326130e 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr @@ -1,29 +1,35 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:5 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:5 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:5 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error[E0515]: cannot return value referencing local data `*v` --> $DIR/regions-close-object-into-object-5.rs:21:5 @@ -37,11 +43,13 @@ LL | Box::new(B(&*v)) as Box error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:21:14 | -LL | fn f<'a, T, U>(v: Box + 'static>) -> Box { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // oh dear! LL | Box::new(B(&*v)) as Box | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn f<'a, T: 'static, U>(v: Box + 'static>) -> Box { + | +++++++++ error: aborting due to 5 previous errors diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr index 41dc03e86dd..d8f77ad85c9 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-1.base.stderr @@ -1,18 +1,24 @@ error[E0310]: the parameter type `A` may not live long enough --> $DIR/regions-close-over-type-parameter-1.rs:15:5 | -LL | fn make_object1(v: A) -> Box { - | -- help: consider adding an explicit lifetime bound...: `A: 'static +` LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn make_object1(v: A) -> Box { + | +++++++++ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-close-over-type-parameter-1.rs:24:5 | -LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box { - | -- help: consider adding an explicit lifetime bound...: `A: 'b +` LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box { + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr index 41dc03e86dd..d8f77ad85c9 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr @@ -1,18 +1,24 @@ error[E0310]: the parameter type `A` may not live long enough --> $DIR/regions-close-over-type-parameter-1.rs:15:5 | -LL | fn make_object1(v: A) -> Box { - | -- help: consider adding an explicit lifetime bound...: `A: 'static +` LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn make_object1(v: A) -> Box { + | +++++++++ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-close-over-type-parameter-1.rs:24:5 | -LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box { - | -- help: consider adding an explicit lifetime bound...: `A: 'b +` LL | Box::new(v) as Box | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn make_object3<'a, 'b, A: SomeTrait + 'a + 'b>(v: A) -> Box { + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-close-param-into-object.base.stderr b/src/test/ui/regions/regions-close-param-into-object.base.stderr index 7e135c65450..79a5d34dea8 100644 --- a/src/test/ui/regions/regions-close-param-into-object.base.stderr +++ b/src/test/ui/regions/regions-close-param-into-object.base.stderr @@ -1,38 +1,46 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:10:5 | -LL | fn p1(v: T) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'static` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | where T : X + 'static + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:16:5 | -LL | fn p2(v: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'static` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `Box` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn p2(v: Box) -> Box + | +++++++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:22:5 | -LL | fn p3<'a,T>(v: T) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | where T : X + 'a + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:28:5 | -LL | fn p4<'a,T>(v: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `Box` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn p4<'a,T: 'a>(v: Box) -> Box + | ++++ error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-close-param-into-object.nll.stderr b/src/test/ui/regions/regions-close-param-into-object.nll.stderr index 3fbc1022631..6ee12d5b82c 100644 --- a/src/test/ui/regions/regions-close-param-into-object.nll.stderr +++ b/src/test/ui/regions/regions-close-param-into-object.nll.stderr @@ -1,38 +1,46 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:10:5 | -LL | fn p1(v: T) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'static` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | where T : X + 'static + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:16:5 | -LL | fn p2(v: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'static` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn p2(v: Box) -> Box + | +++++++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:22:5 | -LL | fn p3<'a,T>(v: T) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | where T : X + 'a + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-close-param-into-object.rs:28:5 | -LL | fn p4<'a,T>(v: Box) -> Box - | - help: consider adding an explicit lifetime bound...: `T: 'a` -... LL | Box::new(v) | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn p4<'a,T: 'a>(v: Box) -> Box + | ++++ error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.rs b/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.rs index f464cab7554..7c2e1aeeea6 100644 --- a/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.rs +++ b/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.rs @@ -9,7 +9,7 @@ // 'a : 'b fn test<'a,'b>(x: &'a i32) -> &'b i32 - where 'a: 'static + where 'a: 'static //~ WARN unnecessary lifetime parameter `'a` { x } diff --git a/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.stderr b/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.stderr index 29ed654f238..70ed418d5cb 100644 --- a/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.stderr +++ b/src/test/ui/regions/regions-free-region-outlives-static-outlives-free-region.stderr @@ -1,8 +1,8 @@ warning: unnecessary lifetime parameter `'a` - --> $DIR/regions-free-region-outlives-static-outlives-free-region.rs:13:5 + --> $DIR/regions-free-region-outlives-static-outlives-free-region.rs:12:11 | -LL | 'a: 'static, - | ^^ +LL | where 'a: 'static + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr index ef68674a18f..85ced4b5241 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.base.stderr @@ -1,11 +1,13 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:10 | -LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo) - | -- help: consider adding an explicit lifetime bound...: `T: 'x +` -LL | { LL | wf::<&'x T>(); | ^^^^^ ...so that the reference type `&'x T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo) + | ++++ error: aborting due to previous error diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr index 6d63de6d6bd..1a428eb25d7 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr @@ -1,11 +1,13 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-implied-bounds-projection-gap-1.rs:20:5 | -LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo) - | -- help: consider adding an explicit lifetime bound...: `T: 'x +` -LL | { LL | wf::<&'x T>(); | ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn func<'x, T:Trait1<'x> + 'x>(t: &'x T::Foo) + | ++++ error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr index 6a7e8ba1347..658740f3f87 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr +++ b/src/test/ui/regions/regions-infer-bound-from-trait.base.stderr @@ -1,8 +1,6 @@ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-infer-bound-from-trait.rs:37:5 | -LL | fn bar1<'a,A>(x: Inv<'a>, a: A) { - | - help: consider adding an explicit lifetime bound...: `A: 'a` LL | check_bound(x, a) | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds... | @@ -11,12 +9,14 @@ note: ...that is required by this bound | LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { } | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) { + | ++++ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-infer-bound-from-trait.rs:41: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 +` LL | check_bound(x, a) | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds... | @@ -25,6 +25,10 @@ note: ...that is required by this bound | LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { } | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) { + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr index 4aa4b468eaa..5cc2d20c2e0 100644 --- a/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr +++ b/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr @@ -1,18 +1,24 @@ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-infer-bound-from-trait.rs:37:5 | -LL | fn bar1<'a,A>(x: Inv<'a>, a: A) { - | - help: consider adding an explicit lifetime bound...: `A: 'a` LL | check_bound(x, a) | ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn bar1<'a,A: 'a>(x: Inv<'a>, a: A) { + | ++++ error[E0309]: the parameter type `A` may not live long enough --> $DIR/regions-infer-bound-from-trait.rs:41: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 +` LL | check_bound(x, a) | ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn bar2<'a,'b,A:Is<'b> + 'a>(x: Inv<'a>, y: Inv<'b>, a: A) { + | ++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-static-bound-rpass.rs b/src/test/ui/regions/regions-static-bound-rpass.rs index c91c6f87493..25232b455b6 100644 --- a/src/test/ui/regions/regions-static-bound-rpass.rs +++ b/src/test/ui/regions/regions-static-bound-rpass.rs @@ -1,10 +1,17 @@ // run-pass + fn invariant_id<'a,'b>(t: &'b mut &'static ()) -> &'b mut &'a () where 'a: 'static { t } +//~^ WARN unnecessary lifetime parameter `'a` + fn static_id<'a>(t: &'a ()) -> &'static () where 'a: 'static { t } +//~^ WARN unnecessary lifetime parameter `'a` + fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static () where 'a: 'b, 'b: 'static { t } +//~^ WARN unnecessary lifetime parameter `'b` + fn ref_id<'a>(t: &'a ()) -> &'a () where 'static: 'a { t } static UNIT: () = (); diff --git a/src/test/ui/regions/regions-static-bound-rpass.stderr b/src/test/ui/regions/regions-static-bound-rpass.stderr index 202c56a5456..9355a409d50 100644 --- a/src/test/ui/regions/regions-static-bound-rpass.stderr +++ b/src/test/ui/regions/regions-static-bound-rpass.stderr @@ -1,24 +1,24 @@ warning: unnecessary lifetime parameter `'a` - --> $DIR/regions-static-bound-rpass.rs:5:5 + --> $DIR/regions-static-bound-rpass.rs:4:11 | -LL | 'a: 'static, - | ^^ +LL | where 'a: 'static { t } + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` warning: unnecessary lifetime parameter `'a` - --> $DIR/regions-static-bound-rpass.rs:12:5 + --> $DIR/regions-static-bound-rpass.rs:8:11 | -LL | 'a: 'static, - | ^^ +LL | where 'a: 'static { t } + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` warning: unnecessary lifetime parameter `'b` - --> $DIR/regions-static-bound-rpass.rs:20:5 + --> $DIR/regions-static-bound-rpass.rs:12:19 | -LL | 'b: 'static, - | ^^ +LL | where 'a: 'b, 'b: 'static { t } + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'b` diff --git a/src/test/ui/regions/regions-static-bound.base.stderr b/src/test/ui/regions/regions-static-bound.base.stderr index b37ce1e76bd..6b8120444d0 100644 --- a/src/test/ui/regions/regions-static-bound.base.stderr +++ b/src/test/ui/regions/regions-static-bound.base.stderr @@ -1,18 +1,34 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/regions-static-bound.rs:6:11 + | +LL | where 'a: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +warning: unnecessary lifetime parameter `'b` + --> $DIR/regions-static-bound.rs:10:19 + | +LL | where 'a: 'b, 'b: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'b` + error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/regions-static-bound.rs:10:5 + --> $DIR/regions-static-bound.rs:14:5 | LL | t | ^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/regions-static-bound.rs:9:24 + --> $DIR/regions-static-bound.rs:13:24 | LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | ^^ error[E0759]: `u` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-static-bound.rs:16:5 + --> $DIR/regions-static-bound.rs:20:5 | LL | fn error(u: &(), v: &()) { | --- this data with an anonymous lifetime `'_`... @@ -20,13 +36,13 @@ LL | static_id(&u); | ^^^^^^^^^ -- ...is used here... | note: ...and is required to live as long as `'static` here - --> $DIR/regions-static-bound.rs:16:5 + --> $DIR/regions-static-bound.rs:20:5 | LL | static_id(&u); | ^^^^^^^^^ error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/regions-static-bound.rs:19:5 + --> $DIR/regions-static-bound.rs:23:5 | LL | fn error(u: &(), v: &()) { | --- this data with an anonymous lifetime `'_`... @@ -35,12 +51,12 @@ LL | static_id_indirect(&v); | ^^^^^^^^^^^^^^^^^^ -- ...is used here... | note: ...and is required to live as long as `'static` here - --> $DIR/regions-static-bound.rs:19:5 + --> $DIR/regions-static-bound.rs:23:5 | LL | static_id_indirect(&v); | ^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 2 warnings emitted Some errors have detailed explanations: E0312, E0759. For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.nll.stderr index d228c42f995..68e36f3aeea 100644 --- a/src/test/ui/regions/regions-static-bound.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.nll.stderr @@ -1,5 +1,21 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/regions-static-bound.rs:6:11 + | +LL | where 'a: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +warning: unnecessary lifetime parameter `'b` + --> $DIR/regions-static-bound.rs:10:19 + | +LL | where 'a: 'b, 'b: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'b` + error: lifetime may not live long enough - --> $DIR/regions-static-bound.rs:10:5 + --> $DIR/regions-static-bound.rs:14:5 | LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here @@ -7,7 +23,7 @@ LL | t | ^ returning this value requires that `'a` must outlive `'static` error[E0521]: borrowed data escapes outside of function - --> $DIR/regions-static-bound.rs:16:5 + --> $DIR/regions-static-bound.rs:20:5 | LL | fn error(u: &(), v: &()) { | - - let's call the lifetime of this reference `'1` @@ -20,7 +36,7 @@ LL | static_id(&u); | argument requires that `'1` must outlive `'static` error[E0521]: borrowed data escapes outside of function - --> $DIR/regions-static-bound.rs:19:5 + --> $DIR/regions-static-bound.rs:23:5 | LL | fn error(u: &(), v: &()) { | - - let's call the lifetime of this reference `'2` @@ -33,6 +49,6 @@ LL | static_id_indirect(&v); | `v` escapes the function body here | argument requires that `'2` must outlive `'static` -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 2 warnings emitted For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/regions/regions-static-bound.rs b/src/test/ui/regions/regions-static-bound.rs index 058b717c95d..1eed7e71745 100644 --- a/src/test/ui/regions/regions-static-bound.rs +++ b/src/test/ui/regions/regions-static-bound.rs @@ -4,8 +4,12 @@ fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t } +//~^ WARN unnecessary lifetime parameter `'a` + fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static () where 'a: 'b, 'b: 'static { t } +//~^ WARN unnecessary lifetime parameter `'b` + fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { t //[base]~^ ERROR E0312 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 1f387a042e6..950ffd6c89b 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 @@ -1,8 +1,6 @@ error[E0310]: the parameter type `U` may not live long enough --> $DIR/dont-infer-static.rs:8:10 | -LL | struct Foo { - | - help: consider adding an explicit lifetime bound...: `U: 'static` LL | bar: Bar | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds... | @@ -11,6 +9,10 @@ note: ...that is required by this bound | LL | struct Bar { | ^^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | struct Foo { + | +++++++++ error: aborting due to previous error 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 553a3e71c16..2c660b28500 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 @@ -1,27 +1,35 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-enum-not-wf.rs:17:18 | -LL | enum Ref1<'a, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | Ref1Variant1(RequireOutlives<'a, T>), | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum Ref1<'a, T: 'a> { + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-enum-not-wf.rs:22:25 | -LL | enum Ref2<'a, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'a` -LL | Ref2Variant1, LL | Ref2Variant2(isize, RequireOutlives<'a, T>), | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum Ref2<'a, T: 'a> { + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-enum-not-wf.rs:35:23 | -LL | enum RefDouble<'a, 'b, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'b` LL | RefDoubleVariant1(&'a RequireOutlives<'b, T>), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum RefDouble<'a, 'b, T: 'b> { + | ++++ error: aborting due to 3 previous errors 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 f8861262991..34ff1362cf3 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 @@ -1,16 +1,17 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-struct-not-wf.rs:13:16 | -LL | impl<'a, T> Trait<'a, T> for usize { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | type Out = &'a T; | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | impl<'a, T: 'a> Trait<'a, T> for usize { + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/regions-struct-not-wf.rs:21:16 | -LL | impl<'a, T> Trait<'a, T> for u32 { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | type Out = RefOk<'a, T>; | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... | @@ -19,6 +20,10 @@ note: ...that is required by this bound | LL | struct RefOk<'a, T:'a> { | ^^ +help: consider adding an explicit lifetime bound... + | +LL | impl<'a, T: 'a> Trait<'a, T> for u32 { + | ++++ error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references --> $DIR/regions-struct-not-wf.rs:25:16 diff --git a/src/test/ui/static/static-lifetime-bound.stderr b/src/test/ui/static/static-lifetime-bound.stderr index 79d9506619e..ef07a89315f 100644 --- a/src/test/ui/static/static-lifetime-bound.stderr +++ b/src/test/ui/static/static-lifetime-bound.stderr @@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a` --> $DIR/static-lifetime-bound.rs:1:6 | LL | fn f<'a: 'static>(_: &'a i32) {} - | ^^^^^^^^^^^ + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` diff --git a/src/test/ui/suggestions/bound-suggestions.fixed b/src/test/ui/suggestions/bound-suggestions.fixed index 31fdd2b67e2..17a019c6984 100644 --- a/src/test/ui/suggestions/bound-suggestions.fixed +++ b/src/test/ui/suggestions/bound-suggestions.fixed @@ -35,7 +35,7 @@ fn test_one_bound_where(x: X) where X: Sized + std::fmt::Debug { } #[allow(dead_code)] -fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: std::fmt::Debug { +fn test_many_bounds_where(x: X) where X: Sized + std::fmt::Debug, X: Sized { println!("{:?}", x); //~^ ERROR doesn't implement } diff --git a/src/test/ui/suggestions/bound-suggestions.stderr b/src/test/ui/suggestions/bound-suggestions.stderr index 04f233a1e87..e5e19444d24 100644 --- a/src/test/ui/suggestions/bound-suggestions.stderr +++ b/src/test/ui/suggestions/bound-suggestions.stderr @@ -65,10 +65,10 @@ LL | println!("{:?}", x); | ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug` | = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider further restricting type parameter `X` +help: consider further restricting this bound | -LL | fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: std::fmt::Debug { - | ++++++++++++++++++++ +LL | fn test_many_bounds_where(x: X) where X: Sized + std::fmt::Debug, X: Sized { + | +++++++++++++++++ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:44:46 diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr index 6255df06efb..8ec7b7bf496 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr +++ b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr @@ -8,7 +8,7 @@ LL | foo.hello(); help: the following trait defines an item `hello`, perhaps you need to restrict type parameter `impl Foo` with it: | LL | fn test(foo: impl Foo + Bar) { - | ~~~~~~~~~~~~~~ + | +++++ error: aborting due to previous error diff --git a/src/test/ui/suggestions/issue-21673.stderr b/src/test/ui/suggestions/issue-21673.stderr index eda29f876d8..0a4aaa61bc7 100644 --- a/src/test/ui/suggestions/issue-21673.stderr +++ b/src/test/ui/suggestions/issue-21673.stderr @@ -7,8 +7,8 @@ LL | x.method() = help: items from traits can only be used if the type parameter is bounded by the trait help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: | -LL | fn call_method(x: &T) { - | ~~~~~~~~ +LL | fn call_method(x: &T) { + | +++++ error[E0599]: no method named `method` found for type parameter `T` in the current scope --> $DIR/issue-21673.rs:10:7 @@ -20,7 +20,7 @@ LL | x.method() help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: | LL | fn call_method_2(x: T) { - | ~~~~~~ + | +++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr index adb928aa8a3..5d195e5ff32 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr @@ -1,8 +1,6 @@ error[E0311]: the parameter type `T` may not live long enough --> $DIR/missing-lifetimes-in-signature-2.rs:20:9 | -LL | fn func(foo: &Foo, t: T) { - | -- help: consider adding an explicit lifetime bound...: `T: 'a +` LL | foo.bar(move |_| { | ^^^ | @@ -21,6 +19,10 @@ note: ...that is required by this bound | LL | F: 'a, | ^^ +help: consider adding an explicit lifetime bound... + | +LL | fn func(foo: &Foo, t: T) { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr index 7526aadb38c..ae9a020a099 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr @@ -41,8 +41,11 @@ LL | fn bar(g: G, dest: &mut T) -> impl FnOnce() + '_ | ^^^^^^^^^^^^^^^^^^ help: consider introducing an explicit lifetime bound | -LL | fn bar<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a - | ~~~~~ ++++ +LL ~ fn bar<'a, G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a +LL | +LL | where +LL ~ G: Get + 'a, + | error[E0311]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:48:45 @@ -62,8 +65,8 @@ LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ^^^^^^^^^^^^^^^^^^ help: consider introducing an explicit lifetime bound | -LL | fn qux<'b, 'a, G: 'b + 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'b - | +++ ~~~~~~~ ++++ +LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'b + | +++ ++++ ++++ error[E0311]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:60:58 @@ -83,8 +86,8 @@ LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ^^^^^^^^^^^^^^^^^^ help: consider introducing an explicit lifetime bound | -LL | fn qux<'c, 'b, G: 'c + Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'c { - | +++ ~~~~~~~ ++++ +LL | fn qux<'c, 'b, G: Get + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'c { + | +++ ++++ ++++ error[E0621]: explicit lifetime required in the type of `dest` --> $DIR/missing-lifetimes-in-signature.rs:69:45 @@ -98,9 +101,12 @@ error[E0309]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:80:44 | LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a - | - ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:85:5: 87:6]` will meet its required lifetime bounds - | | - | help: consider adding an explicit lifetime bound...: `G: 'a` + | ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:85:5: 87:6]` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | G: Get + 'a, + | ++++ error: aborting due to 7 previous errors diff --git a/src/test/ui/suggestions/restrict-type-argument.stderr b/src/test/ui/suggestions/restrict-type-argument.stderr index 551a7c5060f..01c2de79864 100644 --- a/src/test/ui/suggestions/restrict-type-argument.stderr +++ b/src/test/ui/suggestions/restrict-type-argument.stderr @@ -85,8 +85,8 @@ LL | fn is_send(val: T) {} | ^^^^ required by this bound in `is_send` help: consider further restricting this bound | -LL | fn use_bound_and_where(val: S) where S: std::fmt::Debug + std::marker::Send { - | +++++++++++++++++++ +LL | fn use_bound_and_where(val: S) where S: std::fmt::Debug { + | +++++++++++++++++++ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:28:13 diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr index e4a247993c2..4a99c3a14d7 100644 --- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr +++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr @@ -1,9 +1,6 @@ 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); | ^^^ ...so that the type `impl Debug` will meet its required lifetime bounds... | @@ -12,6 +9,10 @@ note: ...that is required by this bound | LL | fn bar(d: impl Debug + 'static) { | ^^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn foo(d: impl Debug + 'static) { + | +++++++++ error: aborting due to previous error diff --git a/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr b/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr index cb1128fe5c6..35d41c62667 100644 --- a/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr +++ b/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr @@ -7,8 +7,8 @@ LL | t.foo() = help: items from traits can only be used if the type parameter is bounded by the trait help: the following trait defines an item `foo`, perhaps you need to restrict type parameter `T` with it: | -LL | fn do_stuff(t : T) { - | ~~~~~~~~ +LL | fn do_stuff(t : T) { + | +++++ error: aborting due to previous error diff --git a/src/test/ui/traits/issue-95898.stderr b/src/test/ui/traits/issue-95898.stderr index d7d47905396..0b06b9b6e01 100644 --- a/src/test/ui/traits/issue-95898.stderr +++ b/src/test/ui/traits/issue-95898.stderr @@ -7,8 +7,8 @@ LL | t.clone(); = help: items from traits can only be used if the type parameter is bounded by the trait help: the following trait defines an item `clone`, perhaps you need to restrict type parameter `T` with it: | -LL | fn foo(t: T) { - | ~~~~~~~~ +LL | fn foo(t: T) { + | +++++++ error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr index d87ef2ec79c..920eef11da4 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr @@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a` --> $DIR/bounds-are-checked.rs:8:6 | LL | fn f<'a: 'static>(t: &'a str) -> X<'a> { - | ^^^^^^^^^^^ + | ^^ | = help: you can use the `'static` lifetime directly, in place of `'a` diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr index a3b410c2cfb..593fb8af32f 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr @@ -19,10 +19,13 @@ LL | type WrongGeneric = impl 'static; error[E0310]: the parameter type `T` may not live long enough --> $DIR/generic_type_does_not_live_long_enough.rs:18:5 | -LL | fn wrong_generic(t: T) -> WrongGeneric { - | - help: consider adding an explicit lifetime bound...: `T: 'static` LL | t | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn wrong_generic(t: T) -> WrongGeneric { + | +++++++++ error: aborting due to 3 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr index a3b410c2cfb..593fb8af32f 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr @@ -19,10 +19,13 @@ LL | type WrongGeneric = impl 'static; error[E0310]: the parameter type `T` may not live long enough --> $DIR/generic_type_does_not_live_long_enough.rs:18:5 | -LL | fn wrong_generic(t: T) -> WrongGeneric { - | - help: consider adding an explicit lifetime bound...: `T: 'static` LL | t | ^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn wrong_generic(t: T) -> WrongGeneric { + | +++++++++ error: aborting due to 3 previous errors 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 3f324190b7b..b9d4857a3ef 100644 --- a/src/test/ui/wf/wf-impl-associated-type-region.stderr +++ b/src/test/ui/wf/wf-impl-associated-type-region.stderr @@ -1,10 +1,13 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/wf-impl-associated-type-region.rs:10:16 | -LL | impl<'a, T> Foo<'a> for T { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | type Bar = &'a T; | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | impl<'a, T: 'a> Foo<'a> for T { + | ++++ error: aborting due to previous error 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 44cacf4ef4d..73fbb9ca670 100644 --- a/src/test/ui/wf/wf-in-fn-type-static.stderr +++ b/src/test/ui/wf/wf-in-fn-type-static.stderr @@ -1,20 +1,24 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/wf-in-fn-type-static.rs:13:8 | -LL | struct Foo { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // needs T: 'static LL | x: fn() -> &'static T | ^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | struct Foo { + | +++++++++ error[E0310]: the parameter type `T` may not live long enough --> $DIR/wf-in-fn-type-static.rs:18:8 | -LL | struct Bar { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // needs T: Copy LL | x: fn(&'static T) | ^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | struct Bar { + | +++++++++ error: aborting due to 2 previous errors 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 c50a6bb6e4d..c3ad42dd5d5 100644 --- a/src/test/ui/wf/wf-in-obj-type-static.stderr +++ b/src/test/ui/wf/wf-in-obj-type-static.stderr @@ -1,11 +1,13 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/wf-in-obj-type-static.rs:14:8 | -LL | struct Foo { - | - help: consider adding an explicit lifetime bound...: `T: 'static` -LL | // needs T: 'static LL | x: dyn Object<&'static T> | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | struct Foo { + | +++++++++ error: aborting due to previous error 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 68c1e9091d7..4d4d8b2ab4d 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 @@ -1,18 +1,24 @@ error[E0309]: the parameter type `T` may not live long enough --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:16 | -LL | impl<'a, T> Trait<'a, T> for usize { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | type Out = &'a fn(T); | ^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | impl<'a, T: 'a> Trait<'a, T> for usize { + | ++++ error[E0309]: the parameter type `T` may not live long enough --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:16 | -LL | impl<'a, T> Trait<'a, T> for u32 { - | - help: consider adding an explicit lifetime bound...: `T: 'a` LL | type Out = &'a dyn Baz; | ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz + 'a)` does not outlive the data it points at + | +help: consider adding an explicit lifetime bound... + | +LL | impl<'a, T: 'a> Trait<'a, T> for u32 { + | ++++ error: aborting due to 2 previous errors diff --git a/src/tools/clippy/tests/ui/extra_unused_lifetimes.stderr b/src/tools/clippy/tests/ui/extra_unused_lifetimes.stderr index ebdb8e74952..9143fb2c208 100644 --- a/src/tools/clippy/tests/ui/extra_unused_lifetimes.stderr +++ b/src/tools/clippy/tests/ui/extra_unused_lifetimes.stderr @@ -6,12 +6,6 @@ LL | fn unused_lt<'a>(x: u8) {} | = note: `-D clippy::extra-unused-lifetimes` implied by `-D warnings` -error: this lifetime isn't used in the function definition - --> $DIR/extra_unused_lifetimes.rs:16:25 - | -LL | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) { - | ^^ - error: this lifetime isn't used in the function definition --> $DIR/extra_unused_lifetimes.rs:41:10 | @@ -24,5 +18,5 @@ error: this lifetime isn't used in the function definition LL | fn unused_lt<'a>(x: u8) {} | ^^ -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/needless_lifetimes.stderr b/src/tools/clippy/tests/ui/needless_lifetimes.stderr index ffa152427a9..a488bc01fff 100644 --- a/src/tools/clippy/tests/ui/needless_lifetimes.stderr +++ b/src/tools/clippy/tests/ui/needless_lifetimes.stderr @@ -108,12 +108,6 @@ error: explicit lifetimes given in parameter types where they could be elided (o LL | fn baz<'a>(&'a self) -> impl Foo + 'a { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) - --> $DIR/needless_lifetimes.rs:307:5 - | -LL | fn impl_trait_elidable_nested_named_lifetimes<'a>(i: &'a i32, f: impl for<'b> Fn(&'b i32) -> &'b i32) -> &'a i32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) --> $DIR/needless_lifetimes.rs:310:5 | @@ -192,5 +186,5 @@ error: explicit lifetimes given in parameter types where they could be elided (o LL | fn lifetime_elsewhere_provided<'a>(self: Box, here: &'a ()) -> &'a () { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 32 previous errors +error: aborting due to 31 previous errors