From 3f382999ab81c9287e03a3c6021f98fd4fe0c268 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 20 May 2019 19:19:49 +0200 Subject: [PATCH] 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}` --- ...unused_lt.rs => extra_unused_lifetimes.rs} | 0 ...t.stderr => extra_unused_lifetimes.stderr} | 6 ++-- .../{lifetimes.rs => needless_lifetimes.rs} | 2 +- ...times.stderr => needless_lifetimes.stderr} | 30 +++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) rename tests/ui/{unused_lt.rs => extra_unused_lifetimes.rs} (100%) rename tests/ui/{unused_lt.stderr => extra_unused_lifetimes.stderr} (79%) rename tests/ui/{lifetimes.rs => needless_lifetimes.rs} (98%) rename tests/ui/{lifetimes.stderr => needless_lifetimes.stderr} (87%) diff --git a/tests/ui/unused_lt.rs b/tests/ui/extra_unused_lifetimes.rs similarity index 100% rename from tests/ui/unused_lt.rs rename to tests/ui/extra_unused_lifetimes.rs diff --git a/tests/ui/unused_lt.stderr b/tests/ui/extra_unused_lifetimes.stderr similarity index 79% rename from tests/ui/unused_lt.stderr rename to tests/ui/extra_unused_lifetimes.stderr index bf4aedd52a97..6473a2fbcb28 100644 --- a/tests/ui/unused_lt.stderr +++ b/tests/ui/extra_unused_lifetimes.stderr @@ -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) {} | ^^ diff --git a/tests/ui/lifetimes.rs b/tests/ui/needless_lifetimes.rs similarity index 98% rename from tests/ui/lifetimes.rs rename to tests/ui/needless_lifetimes.rs index 2cb236fa3bc3..e2d680ceaeb1 100644 --- a/tests/ui/lifetimes.rs +++ b/tests/ui/needless_lifetimes.rs @@ -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) {} diff --git a/tests/ui/lifetimes.stderr b/tests/ui/needless_lifetimes.stderr similarity index 87% rename from tests/ui/lifetimes.stderr rename to tests/ui/needless_lifetimes.stderr index 9eac0407e4d5..9334076fc71c 100644 --- a/tests/ui/lifetimes.stderr +++ b/tests/ui/needless_lifetimes.stderr @@ -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!()