Skip to content

Commit 64c1d3b

Browse files
committed
Auto merge of #4120 - phansch:needless_lifetimes_async_test_cleanup, r=Manishearth
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}`
2 parents a8eeb7c + 3f38299 commit 64c1d3b

4 files changed

+19
-19
lines changed
File renamed without changes.

tests/ui/unused_lt.stderr renamed to tests/ui/extra_unused_lifetimes.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: this lifetime isn't used in the function definition
2-
--> $DIR/unused_lt.rs:14:14
2+
--> $DIR/extra_unused_lifetimes.rs:14:14
33
|
44
LL | fn unused_lt<'a>(x: u8) {}
55
| ^^
66
|
77
= note: `-D clippy::extra-unused-lifetimes` implied by `-D warnings`
88

99
error: this lifetime isn't used in the function definition
10-
--> $DIR/unused_lt.rs:16:25
10+
--> $DIR/extra_unused_lifetimes.rs:16:25
1111
|
1212
LL | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
1313
| ^^
1414

1515
error: this lifetime isn't used in the function definition
16-
--> $DIR/unused_lt.rs:41:10
16+
--> $DIR/extra_unused_lifetimes.rs:41:10
1717
|
1818
LL | fn x<'a>(&self) {}
1919
| ^^

tests/ui/lifetimes.rs renamed to tests/ui/needless_lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::needless_lifetimes, clippy::extra_unused_lifetimes)]
1+
#![warn(clippy::needless_lifetimes)]
22
#![allow(dead_code, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)]
33

44
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}

tests/ui/lifetimes.stderr renamed to tests/ui/needless_lifetimes.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
2-
--> $DIR/lifetimes.rs:4:1
2+
--> $DIR/needless_lifetimes.rs:4:1
33
|
44
LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
88

99
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
10-
--> $DIR/lifetimes.rs:6:1
10+
--> $DIR/needless_lifetimes.rs:6:1
1111
|
1212
LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
16-
--> $DIR/lifetimes.rs:16:1
16+
--> $DIR/needless_lifetimes.rs:16:1
1717
|
1818
LL | / fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
1919
LL | | x
2020
LL | | }
2121
| |_^
2222

2323
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
24-
--> $DIR/lifetimes.rs:45:1
24+
--> $DIR/needless_lifetimes.rs:45:1
2525
|
2626
LL | / fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
2727
LL | | Ok(x)
2828
LL | | }
2929
| |_^
3030

3131
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
32-
--> $DIR/lifetimes.rs:50:1
32+
--> $DIR/needless_lifetimes.rs:50:1
3333
|
3434
LL | / fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
3535
LL | | where
@@ -40,13 +40,13 @@ LL | | }
4040
| |_^
4141

4242
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
43-
--> $DIR/lifetimes.rs:62:1
43+
--> $DIR/needless_lifetimes.rs:62:1
4444
|
4545
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
4646
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4747

4848
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
49-
--> $DIR/lifetimes.rs:86:1
49+
--> $DIR/needless_lifetimes.rs:86:1
5050
|
5151
LL | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
5252
LL | | where
@@ -57,61 +57,61 @@ LL | | }
5757
| |_^
5858

5959
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
60-
--> $DIR/lifetimes.rs:120:5
60+
--> $DIR/needless_lifetimes.rs:120:5
6161
|
6262
LL | / fn self_and_out<'s>(&'s self) -> &'s u8 {
6363
LL | | &self.x
6464
LL | | }
6565
| |_____^
6666

6767
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
68-
--> $DIR/lifetimes.rs:129:5
68+
--> $DIR/needless_lifetimes.rs:129:5
6969
|
7070
LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272

7373
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
74-
--> $DIR/lifetimes.rs:148:1
74+
--> $DIR/needless_lifetimes.rs:148:1
7575
|
7676
LL | / fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
7777
LL | | unimplemented!()
7878
LL | | }
7979
| |_^
8080

8181
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
82-
--> $DIR/lifetimes.rs:178:1
82+
--> $DIR/needless_lifetimes.rs:178:1
8383
|
8484
LL | / fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str {
8585
LL | | unimplemented!()
8686
LL | | }
8787
| |_^
8888

8989
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
90-
--> $DIR/lifetimes.rs:184:1
90+
--> $DIR/needless_lifetimes.rs:184:1
9191
|
9292
LL | / fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
9393
LL | | unimplemented!()
9494
LL | | }
9595
| |_^
9696

9797
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
98-
--> $DIR/lifetimes.rs:203:1
98+
--> $DIR/needless_lifetimes.rs:203:1
9999
|
100100
LL | / fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
101101
LL | | unimplemented!()
102102
LL | | }
103103
| |_^
104104

105105
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
106-
--> $DIR/lifetimes.rs:211:1
106+
--> $DIR/needless_lifetimes.rs:211:1
107107
|
108108
LL | / fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
109109
LL | | unimplemented!()
110110
LL | | }
111111
| |_^
112112

113113
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
114-
--> $DIR/lifetimes.rs:247:1
114+
--> $DIR/needless_lifetimes.rs:247:1
115115
|
116116
LL | / fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
117117
LL | | unimplemented!()

0 commit comments

Comments
 (0)