Skip to content

Commit 289216f

Browse files
committed
Bless clippy test.
1 parent a3f2a32 commit 289216f

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/tools/clippy/tests/ui/manual_async_fn.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
8080
async { 42 }
8181
}
8282

83+
#[allow(clippy::needless_lifetimes)]
8384
async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
8485

8586
// should be ignored

src/tools/clippy/tests/ui/manual_async_fn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
9898
async { 42 }
9999
}
100100

101+
#[allow(clippy::needless_lifetimes)]
101102
fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
102103
async { 42 }
103104
}

src/tools/clippy/tests/ui/manual_async_fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
140140
| ~~~~~~
141141

142142
error: this function can be simplified using the `async fn` syntax
143-
--> $DIR/manual_async_fn.rs:101:1
143+
--> $DIR/manual_async_fn.rs:102:1
144144
|
145145
LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
146146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/tools/clippy/tests/ui/needless_lifetimes.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ error: explicit lifetimes given in parameter types where they could be elided (o
1818
LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

21+
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
22+
--> $DIR/needless_lifetimes.rs:37:1
23+
|
24+
LL | async fn func<'a>(args: &[&'a str]) -> Option<&'a str> {
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
2127
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
2228
--> $DIR/needless_lifetimes.rs:56:1
2329
|
@@ -192,5 +198,5 @@ error: explicit lifetimes given in parameter types where they could be elided (o
192198
LL | fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
193199
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194200

195-
error: aborting due to 32 previous errors
201+
error: aborting due to 33 previous errors
196202

0 commit comments

Comments
 (0)