use impl_template::impl_template; trait GenericFoo { fn do_something(&self) -> T; } struct Bar; struct Baz; struct Xyz; #[impl_template] impl GenericFoo<((Bar, Baz))> for Xyz { fn do_something(&self) -> __TYPE0__ { __TYPE0__ } } fn main() { assert_impls_foo::(); assert_impls_foo::(); let _bar: Bar = Xyz.do_something(); let _baz: Baz = Xyz.do_something(); } fn assert_impls_foo, T>() {}