File tree Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -414,10 +414,22 @@ fn transform_block(
414
414
if !is_local {
415
415
self_param. bounds . extend ( self_bound) ;
416
416
}
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 ( ) ;
417
429
standalone
418
430
. generics
419
431
. params
420
- . push ( GenericParam :: Type ( self_param) ) ;
432
+ . insert ( count , GenericParam :: Type ( self_param) ) ;
421
433
types. push ( Ident :: new ( "Self" , Span :: call_site ( ) ) ) ;
422
434
}
423
435
}
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
+ ) ]
2
5
3
6
use async_trait:: async_trait;
4
7
@@ -1048,3 +1051,29 @@ pub mod issue129 {
1048
1051
}
1049
1052
}
1050
1053
}
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