File tree Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -414,10 +414,22 @@ fn transform_block(
414414 if !is_local {
415415 self_param. bounds . extend ( self_bound) ;
416416 }
417+ let count = standalone
418+ . generics
419+ . params
420+ . iter ( )
421+ . take_while ( |param| {
422+ if let GenericParam :: Const ( _) = param {
423+ false
424+ } else {
425+ true
426+ }
427+ } )
428+ . count ( ) ;
417429 standalone
418430 . generics
419431 . params
420- . push ( GenericParam :: Type ( self_param) ) ;
432+ . insert ( count , GenericParam :: Type ( self_param) ) ;
421433 types. push ( Ident :: new ( "Self" , Span :: call_site ( ) ) ) ;
422434 }
423435 }
Original file line number Diff line number Diff line change 303303//! let object = &value as &dyn ObjectSafe;
304304//! ```
305305
306+ #![ allow( clippy:: match_like_matches_macro) ] // matches! requires Rust 1.42
307+
306308extern crate proc_macro;
307309
308310mod args;
Original file line number Diff line number Diff line change 1- #![ cfg_attr( async_trait_nightly_testing, feature( specialization, const_generics) ) ]
1+ #![ cfg_attr(
2+ async_trait_nightly_testing,
3+ feature( min_specialization, min_const_generics)
4+ ) ]
25
36use async_trait:: async_trait;
47
@@ -1048,3 +1051,29 @@ pub mod issue129 {
10481051 }
10491052 }
10501053}
1054+
1055+ // https://github.com/dtolnay/async-trait/issues/134
1056+ #[ cfg( async_trait_nightly_testing) ]
1057+ pub mod issue134 {
1058+ use async_trait:: async_trait;
1059+
1060+ #[ async_trait]
1061+ trait TestTrait {
1062+ async fn run < const DUMMY : bool > ( self ) -> ( )
1063+ where
1064+ Self : Sized ,
1065+ {
1066+ }
1067+ }
1068+
1069+ pub struct TestStruct ;
1070+
1071+ #[ async_trait]
1072+ impl TestTrait for TestStruct {
1073+ async fn run < const DUMMY : bool > ( self ) -> ( )
1074+ where
1075+ Self : Sized ,
1076+ {
1077+ }
1078+ }
1079+ }
You can’t perform that action at this time.
0 commit comments