Skip to content

Commit

Permalink
Add test for rust-lang#5787
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Jan 22, 2023
1 parent e0ee58b commit b065ad6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ui/needless_lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,21 @@ mod pr_9743_output_lifetime_checks {
}
}

mod issue5787 {
use std::sync::MutexGuard;

struct Foo;

impl Foo {
// doesn't get linted without async
pub async fn wait<'a, T>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T> {
guard
}
}

async fn foo<'a>(_x: &i32, y: &'a str) -> &'a str {
y
}
}

fn main() {}

0 comments on commit b065ad6

Please sign in to comment.