File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ pub fn has_self_in_block(block: &mut Block) -> bool {
1919struct HasSelf ( bool ) ;
2020
2121impl VisitMut for HasSelf {
22+ fn visit_expr_path_mut ( & mut self , expr : & mut ExprPath ) {
23+ self . 0 |= expr. path . segments [ 0 ] . ident == "Self" ;
24+ visit_mut:: visit_expr_path_mut ( self , expr) ;
25+ }
26+
2227 fn visit_type_path_mut ( & mut self , ty : & mut TypePath ) {
2328 self . 0 |= ty. path . segments [ 0 ] . ident == "Self" ;
2429 visit_mut:: visit_type_path_mut ( self , ty) ;
Original file line number Diff line number Diff line change @@ -341,3 +341,22 @@ mod issue28 {
341341 async fn h ( ) ; // do not chain
342342 }
343343}
344+
345+ // https://github.com/dtolnay/async-trait/issues/31
346+ pub mod issue31 {
347+ use async_trait:: async_trait;
348+
349+ pub struct Struct < ' a > {
350+ pub name : & ' a str ,
351+ }
352+
353+ #[ async_trait]
354+ pub trait Trait < ' a > {
355+ async fn hello ( thing : Struct < ' a > ) -> String ;
356+ async fn hello_twice ( one : Struct < ' a > , two : Struct < ' a > ) -> String {
357+ let str1 = Self :: hello ( one) . await ;
358+ let str2 = Self :: hello ( two) . await ;
359+ str1 + & str2
360+ }
361+ }
362+ }
You can’t perform that action at this time.
0 commit comments