about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/async_yields_async.fixed
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-05 02:01:50 +0000
committerbors <bors@rust-lang.org>2025-09-05 02:01:50 +0000
commit91edc3ebccc4daa46c20a93f4709862376da1fdd (patch)
tree63e75231cb63d011d54d9cd3e771fb4b91eb81da /src/tools/clippy/tests/ui/async_yields_async.fixed
parentb3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7 (diff)
parent75b9ee5f085f695cba061fd9ed7fa3b912dd1bbf (diff)
downloadrust-91edc3ebccc4daa46c20a93f4709862376da1fdd.tar.gz
rust-91edc3ebccc4daa46c20a93f4709862376da1fdd.zip
Auto merge of #146218 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
Diffstat (limited to 'src/tools/clippy/tests/ui/async_yields_async.fixed')
-rw-r--r--src/tools/clippy/tests/ui/async_yields_async.fixed39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/async_yields_async.fixed b/src/tools/clippy/tests/ui/async_yields_async.fixed
index 93c573d3086..bd1b31f74ee 100644
--- a/src/tools/clippy/tests/ui/async_yields_async.fixed
+++ b/src/tools/clippy/tests/ui/async_yields_async.fixed
@@ -80,3 +80,42 @@ fn check_expect_suppression() {
         }
     };
 }
+
+#[allow(clippy::let_underscore_future)]
+fn issue15552() {
+    async fn bar(i: i32) {}
+
+    macro_rules! call_bar {
+        () => {
+            async { bar(5).await }
+        };
+        ($e:expr) => {
+            bar($e)
+        };
+    }
+    let x = async { call_bar!(5).await };
+    //~^ async_yields_async
+    let y = async { call_bar!().await };
+    //~^ async_yields_async
+    //~| async_yields_async
+
+    use std::future::{Future, Ready};
+    use std::ops::Add;
+    use std::pin::Pin;
+    use std::task::{Context, Poll};
+    struct CustomFutureType;
+    impl Add for CustomFutureType {
+        type Output = Self;
+        fn add(self, other: Self) -> Self {
+            self
+        }
+    }
+    impl Future for CustomFutureType {
+        type Output = ();
+        fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
+            Poll::Ready(())
+        }
+    }
+    let _ = async { (CustomFutureType + CustomFutureType).await };
+    //~^ async_yields_async
+}