Skip to content

Commit e2f544f

Browse files
committed
Add regression test for issue 17
1 parent bbceb93 commit e2f544f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,24 @@ mod issue15 {
204204
async fn myfn(&self, _: PhantomData<dyn Trait + Send>) {}
205205
}
206206
}
207+
208+
// https://github.com/dtolnay/async-trait/issues/17
209+
mod issue17 {
210+
use async_trait::async_trait;
211+
212+
#[async_trait]
213+
trait Issue17 {
214+
async fn f(&self);
215+
}
216+
217+
struct Struct {
218+
string: String,
219+
}
220+
221+
#[async_trait]
222+
impl Issue17 for Struct {
223+
async fn f(&self) {
224+
println!("{}", self.string);
225+
}
226+
}
227+
}

0 commit comments

Comments
 (0)