I do not think this has necessarily to do with code that depends on more than one trait. But yes I can imagine simple examples where multiple traits are required:
fn to_fast_map(m: BTreeMap<K, V>) -> HashMap<K, V> where K: Hash + Eq + Ord { ... }
fn to_ordered_map(m: HashMap<K, V>) -> BTreeMap<K, V> where K: Hash + Eq + Ord { ... }
I understand the use case but except maybe in specific examples I tend to consider this a bad design. You are exposing the content of your entities. This is against most of principles of limiting visibility of internals and of separating interface and implementation. In particular subcomponents may expose behaviors you do not want the external world to access. What if some invariants exist over multiple components? If it were me I would cope with the burden of writing explicit delegating methods rather than exposing all the internal state. But I can understand sometime you want to be lazy. I think my proposition allow you to be lazy without sacrificing visibility control.
Additionally I think you should not focus too much on composition as a requirement of this proposition. I’m not only considering object that can naturally be thought as aggregations of sub-items. I’m thinking the other way round: what if for implementing a specific trait A for my type T, I could isolate a sub-state substate: S that is dedicated to handling this trait internally? If I could, instances of S would be used as internal components of any type that needs the same implementation for A. So here composition is a possible consequence of this design. And now if you go further you realize you do not necessarily have to consider something as specific as a sub-state (a struct field). All you need is a internal transformation (a function) of type T -> S. Extracting a field |t: T| t.substate is just a peculiar case.
Not that I’m aware of. But I’d like many other language to better handle code reuse (without mixing it with type inheritance).
I’m not sure what you try to show here. That you can trick the type system by relaxing some conditions?