Skip to content

Commit

Permalink
Auto merge of rust-lang#94088 - oli-obk:revert, r=jackh726
Browse files Browse the repository at this point in the history
Revert rust-lang#91403

fixes rust-lang#94004

r? `@pnkfelix` `@cjgillot`
  • Loading branch information
bors committed Feb 18, 2022
2 parents 9af2be8 + 4abaa02 commit a703a82
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion tests/ui/manual_async_fn.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
async { 42 }
}

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

// should be ignored
Expand Down
1 change: 0 additions & 1 deletion tests/ui/manual_async_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ fn elided_not_bound(_: &i32) -> impl Future<Output = i32> {
async { 42 }
}

#[allow(clippy::needless_lifetimes)]
fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
async { 42 }
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/manual_async_fn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
| ~~~~~~

error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:102:1
--> $DIR/manual_async_fn.rs:101:1
|
LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 1 addition & 7 deletions tests/ui/needless_lifetimes.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ error: explicit lifetimes given in parameter types where they could be elided (o
LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/needless_lifetimes.rs:37:1
|
LL | async fn func<'a>(args: &[&'a str]) -> Option<&'a str> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/needless_lifetimes.rs:56:1
|
Expand Down Expand Up @@ -198,5 +192,5 @@ error: explicit lifetimes given in parameter types where they could be elided (o
LL | fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 33 previous errors
error: aborting due to 32 previous errors

0 comments on commit a703a82

Please sign in to comment.