xmh0511
1
Consider we have multiple implementations(pseudo code)
impl<T: Trait0> MyStruct<T>{ // #1
fn show(&self){}
}
impl<T: Trait0 + Trait1> MyStruct<T>{ // #2
fn show(&self){}
}
If the given T
satisfies both the requirements in #1
and #2
, then #2
is used. Is any RFC about this feature?
Specialization, but the full RFC is unsound.
A sound subset is min specialization.
See also.
(Neither are stable.)
4 Likes
xmh0511
3
The blog sounds like the example in the question is not supported.
system
Closed
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.