what i want to achieve is having a trait with default implementations defined by functions so that implementing structs can have slightly modified behaviour: call the functions but then do something additional.
In OOP terms that would be: i want to call the method of the super class in the derived class.
This gives method cannot be invoked on a trait object though:
You could change the Signature of your default implementation to something Llke this: fn default_impl<T: Trait>(t: &T){}
(I'm on my phone right now so sorry for not giving a complete example)
Also, from the minimal example, you could just move the content from the default impl functions into the trait functions, but I guess you explicitly want to have the code in different functions?
So if the where Self: Sized statement remains in the trait declaration you only need the change @raidwas suggested to make it compile, right? Does your solution make the implementation more flexible or offer some other advantage?
Compared to where Self: Sized? Yes my solution is strictly more powerful, because you can't call where Self: Sized methods on trait objects (e.g. &dyn Trait), whereas that's not a challenge in my case.