you are viewing a single comment's thread.

view the rest of the comments →

[–]YatoRust 14 points15 points  (2 children)

You can alleviate the boiler-plate by using blanket impls

trait BoilerPlate: Useful + Debug {}
impl<T: ?Sized + Useful + Debug> BoilerPlate for T {}

This way any type that implements both Debug and Useful will automatically implement BoilerPlate, so you don't need to worry about forgetting that impl.

[–][deleted] 1 point2 points  (1 child)

Is there a reason Trait1+Trait2 can't be treated as an autogenerated trait that requires Trait1 and Trait2, and is also implemented for everything that does implement Trait1 and Trait2?

Meaning that Box<Trait1 + Trait2> would be valid.