Skip to content

Commit b77d0d5

Browse files
committed
Add regression test for issue 283
error[E0276]: impl has stricter requirements than trait --> tests/test.rs:1699:5 | 1692 | async fn a(); | ------------- definition of `a` from trait ... 1699 | #[async_trait] | ^^^^^^^^^^^^^^ impl has extra requirement `T: 'async_trait` | = note: this error originates in the attribute macro `async_trait` (in Nightly builds, run with -Z macro-backtrace for more info)
1 parent 4c8406d commit b77d0d5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test.rs

+20
Original file line numberDiff line numberDiff line change
@@ -1683,3 +1683,23 @@ pub mod issue281 {
16831683
}
16841684
}
16851685
}
1686+
1687+
pub mod issue283 {
1688+
use async_trait::async_trait;
1689+
1690+
#[async_trait]
1691+
pub trait Trait {
1692+
async fn a();
1693+
}
1694+
1695+
pub trait Bound {
1696+
fn b();
1697+
}
1698+
1699+
#[async_trait]
1700+
impl<T: Bound> Trait for T {
1701+
async fn a() {
1702+
Self::b();
1703+
}
1704+
}
1705+
}

0 commit comments

Comments
 (0)