diff options
| author | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-09-10 09:35:45 +0200 |
|---|---|---|
| committer | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-09-10 10:25:39 +0200 |
| commit | e4f69ea1af40cd43da1aec1d6489ac6e78d3e769 (patch) | |
| tree | e2043edbc72428e82f5d748eb6abfe123d8873ad /tests | |
| parent | 49e2f37b26fbfa1de818cfaacda57b7375165bf5 (diff) | |
| download | rust-e4f69ea1af40cd43da1aec1d6489ac6e78d3e769.tar.gz rust-e4f69ea1af40cd43da1aec1d6489ac6e78d3e769.zip | |
fix(needless_closure): don't lint on `AsyncFn*`s
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/eta.fixed | 8 | ||||
| -rw-r--r-- | tests/ui/eta.rs | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/eta.fixed b/tests/ui/eta.fixed index 6944a979c05..107318e5323 100644 --- a/tests/ui/eta.fixed +++ b/tests/ui/eta.fixed @@ -635,3 +635,11 @@ fn issue8817() { //~| HELP: replace the closure with the tuple variant itself .unwrap(); // just for nicer formatting } + +async fn issue13892<'a, T, F>(maybe: Option<&'a T>, visitor: F) +where + F: AsyncFn(&'a T), + T: 'a, +{ + maybe.map(|x| visitor(x)); +} diff --git a/tests/ui/eta.rs b/tests/ui/eta.rs index 5bcc1cb26fd..b85e8e75153 100644 --- a/tests/ui/eta.rs +++ b/tests/ui/eta.rs @@ -635,3 +635,11 @@ fn issue8817() { //~| HELP: replace the closure with the tuple variant itself .unwrap(); // just for nicer formatting } + +async fn issue13892<'a, T, F>(maybe: Option<&'a T>, visitor: F) +where + F: AsyncFn(&'a T), + T: 'a, +{ + maybe.map(|x| visitor(x)); +} |
