Neither of these work.
pub fn new_generic_input<T>(&self, a: T) { /* some code here */ }
pub fn new_generic_output<T>(&self) -> T { /* some code here */ }
pub fn impl_arg(&self, a: impl SomeTrait) { /* some code here */ }
pub fn impl_out(&self) -> impl SomeTrait { /* some code here */ }
The issue is on the definition of the _when_{} method.
The first two seem solvable together. Add all the generics from the mocked method to the when method.
The third one seems like it would require "de-sugaring" the impl Foo into <T: Foo> for the when method only.
The last one.... 🤷♂️ We could change it into a generic argument to the when method as a first-step MVP (read: hack).