Thomas Eizinger
3 years ago
2 changed files with 58 additions and 2 deletions
@ -0,0 +1,28 @@ |
|||
use async_trait::async_trait; |
|||
use std::marker::PhantomData; |
|||
use xtra_productivity::xtra_productivity; |
|||
|
|||
struct ActorWithParam<C> { |
|||
ty: PhantomData<C>, |
|||
} |
|||
|
|||
struct DummyMessage; |
|||
|
|||
trait Foo {} |
|||
|
|||
impl<C: 'static + Send> xtra::Actor for ActorWithParam<C> {} |
|||
|
|||
// Dummy actor, xtra::Handler and xtra::Message impls generated by xtra_productivity
|
|||
#[xtra_productivity] |
|||
impl<C> ActorWithParam<C> |
|||
where |
|||
C: Foo, |
|||
{ |
|||
pub fn handle_dummy_message(&mut self, _message: DummyMessage) { |
|||
assert_impls_foo::<C>(); |
|||
} |
|||
} |
|||
|
|||
fn assert_impls_foo<T: Foo>() {} |
|||
|
|||
fn main() {} |
Loading…
Reference in new issue