Closed lifthrasiir closed 9 years ago
cc @aturon
Indeed, this seems to've been missed in the original rollout. As usual, this will actually make the default methods more widely usable.
We need to develop a convention around these extra blanket extension traits.
Is it actually unsafe to use Self in the return type?
@taralx It wouldn't make sense from the perspective of the caller. The caller cannot see the concrete type that makes the return value up (T<Self>
and T<Trait>
are quite different). A proxy that converts the return value to the trait object may work, but it is surprising and it still doesn't work for every Self
-typed return value (e.g. iterators).
This has now been addressed.
As a side effect of #17704 (and I think @huonw has noted this possibility correctly),
std::io::Buffer
is no longer usable as a trait object. We need a separate trait and a blacket implementation for it.