2 #![feature(lint_reasons)]
3 #![feature(async_closure)]
4 #![warn(clippy::async_yields_async)]
6 use core::future::Future;
8 use core::task::{Context, Poll};
10 struct CustomFutureType;
12 impl Future for CustomFutureType {
15 fn poll(self: Pin<&mut Self>, _: &mut Context) -> Poll<Self::Output> {
20 fn custom_future_type_ctor() -> CustomFutureType {
24 async fn f() -> CustomFutureType {
25 // Don't warn for functions since you have to explicitly declare their
44 CustomFutureType.await
55 CustomFutureType.await
57 let _l = async || CustomFutureType.await;
59 println!("I'm bored");
62 // Finally something to await
63 CustomFutureType.await
65 let _n = async || custom_future_type_ctor();
66 let _o = async || f();
71 fn check_expect_suppression() {
72 #[expect(clippy::async_yields_async)]