Skip to content

Commit b065ad6

Browse files
committed
Add test for #5787
1 parent e0ee58b commit b065ad6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/ui/needless_lifetimes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,4 +495,21 @@ mod pr_9743_output_lifetime_checks {
495495
}
496496
}
497497

498+
mod issue5787 {
499+
use std::sync::MutexGuard;
500+
501+
struct Foo;
502+
503+
impl Foo {
504+
// doesn't get linted without async
505+
pub async fn wait<'a, T>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T> {
506+
guard
507+
}
508+
}
509+
510+
async fn foo<'a>(_x: &i32, y: &'a str) -> &'a str {
511+
y
512+
}
513+
}
514+
498515
fn main() {}

0 commit comments

Comments
 (0)