File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ pub fn expand(input: &mut Item, is_local: bool) {
119
119
fn lint_suppress_with_body ( ) -> Attribute {
120
120
parse_quote ! {
121
121
#[ allow(
122
+ clippy:: async_yields_async,
122
123
clippy:: let_unit_value,
123
124
clippy:: no_effect_underscore_binding,
124
125
clippy:: shadow_same,
Original file line number Diff line number Diff line change @@ -1556,3 +1556,31 @@ pub mod issue234 {
1556
1556
async fn f ( Tuple { 1 : _int, .. } : Tuple < Droppable , i32 > ) { }
1557
1557
}
1558
1558
}
1559
+
1560
+ // https://github.com/dtolnay/async-trait/issues/236
1561
+ pub mod issue236 {
1562
+ #![ deny( clippy:: async_yields_async) ]
1563
+ #![ allow( clippy:: manual_async_fn) ]
1564
+
1565
+ use async_trait:: async_trait;
1566
+ use std:: future:: { self , Future , Ready } ;
1567
+
1568
+ // Does not trigger the lint.
1569
+ pub async fn async_fn ( ) -> Ready < ( ) > {
1570
+ future:: ready ( ( ) )
1571
+ }
1572
+
1573
+ #[ allow( clippy:: async_yields_async) ]
1574
+ pub fn impl_future_fn ( ) -> impl Future < Output = Ready < ( ) > > {
1575
+ async { future:: ready ( ( ) ) }
1576
+ }
1577
+
1578
+ // The async_trait attribute turns the former into the latter, so we make it
1579
+ // put its own allow(async_yeilds_async) to remain consistent with async fn.
1580
+ #[ async_trait]
1581
+ pub trait Trait {
1582
+ async fn f ( ) -> Ready < ( ) > {
1583
+ future:: ready ( ( ) )
1584
+ }
1585
+ }
1586
+ }
You can’t perform that action at this time.
0 commit comments