impl-template 1.0.0-alpha

A procedural macro for generating impl-blocks based on a simple template.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use impl_template::impl_template;

trait GenericFoo<T> {}

struct Bar;
struct Baz;

struct Xyz;

#[impl_template]
impl GenericFoo<((Bar, Baz))> for Xyz {}

fn main() {
    assert_impls_foo::<Xyz, Bar>();
    assert_impls_foo::<Xyz, Baz>();
}

fn assert_impls_foo<F: GenericFoo<T>, T>() {}