Lifetimes UI test cleanup

* Removes an unneeded `#![warn(clippy::extra_unused_lifetimes)]` from
  the `needless_lifetimes` test - the tests for those are in a different
  file.

* Renames `unused_lt.{rs,stderr}` to `extra_unused_lifetimes.{rs,stderr}`
* Renames `lifetimes.{rs,stderr}` to `needless_lifetimes.{rs,stderr}`
This commit is contained in:
Philipp Hansch 2019-05-20 19:19:49 +02:00
parent 2cc23a5b18
commit 3f382999ab
No known key found for this signature in database
GPG Key ID: 82AA61CAA11397E6
4 changed files with 19 additions and 19 deletions

View File

@ -1,5 +1,5 @@
error: this lifetime isn't used in the function definition
--> $DIR/unused_lt.rs:14:14
--> $DIR/extra_unused_lifetimes.rs:14:14
|
LL | fn unused_lt<'a>(x: u8) {}
| ^^
@ -7,13 +7,13 @@ 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/unused_lt.rs:16:25
--> $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/unused_lt.rs:41:10
--> $DIR/extra_unused_lifetimes.rs:41:10
|
LL | fn x<'a>(&self) {}
| ^^

View File

@ -1,4 +1,4 @@
#![warn(clippy::needless_lifetimes, clippy::extra_unused_lifetimes)]
#![warn(clippy::needless_lifetimes)]
#![allow(dead_code, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)]
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}

View File

@ -1,5 +1,5 @@
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:4:1
--> $DIR/needless_lifetimes.rs:4:1
|
LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,13 +7,13 @@ LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:6:1
--> $DIR/needless_lifetimes.rs:6:1
|
LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:16:1
--> $DIR/needless_lifetimes.rs:16:1
|
LL | / fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
LL | | x
@ -21,7 +21,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:45:1
--> $DIR/needless_lifetimes.rs:45:1
|
LL | / fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
LL | | Ok(x)
@ -29,7 +29,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:50:1
--> $DIR/needless_lifetimes.rs:50:1
|
LL | / fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
LL | | where
@ -40,13 +40,13 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:62:1
--> $DIR/needless_lifetimes.rs:62:1
|
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:86:1
--> $DIR/needless_lifetimes.rs:86:1
|
LL | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
LL | | where
@ -57,7 +57,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:120:5
--> $DIR/needless_lifetimes.rs:120:5
|
LL | / fn self_and_out<'s>(&'s self) -> &'s u8 {
LL | | &self.x
@ -65,13 +65,13 @@ LL | | }
| |_____^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:129:5
--> $DIR/needless_lifetimes.rs:129:5
|
LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:148:1
--> $DIR/needless_lifetimes.rs:148:1
|
LL | / fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
LL | | unimplemented!()
@ -79,7 +79,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:178:1
--> $DIR/needless_lifetimes.rs:178:1
|
LL | / fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str {
LL | | unimplemented!()
@ -87,7 +87,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:184:1
--> $DIR/needless_lifetimes.rs:184:1
|
LL | / fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
LL | | unimplemented!()
@ -95,7 +95,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:203:1
--> $DIR/needless_lifetimes.rs:203:1
|
LL | / fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
LL | | unimplemented!()
@ -103,7 +103,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:211:1
--> $DIR/needless_lifetimes.rs:211:1
|
LL | / fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
LL | | unimplemented!()
@ -111,7 +111,7 @@ LL | | }
| |_^
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/lifetimes.rs:247:1
--> $DIR/needless_lifetimes.rs:247:1
|
LL | / fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
LL | | unimplemented!()