You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As @Kimundi observed in the original impl Trait proposal, this common pattern can be seen in Rust's Iterator trait. Methods like chain return a type that is only Clone if Self: Clone and Other: Clone.
There's some discussion of this in the expanded impl Trait RFC, but I haven't seen any fully-fledged proposals for this yet.
The text was updated successfully, but these errors were encountered:
@withoutboats The only issues I've marked as essential are this issue and the one for "fully-explicit syntax". My reasoning was that all the other issues (e.g. #3) don't add anything to the overall expressiveness of the language, and can be mostly thought as sugar for the fully-explicit syntax (#1).
That said, @aturon and I spoke and agreed that #3 is very high-priority. I'll put together a PR against this repo for a pre-draft RFC so we can discuss in more detail.
The ability to specify that an
impl Trait
return type only implements a trait if some other bound is met.As @Kimundi observed in the original
impl Trait
proposal, this common pattern can be seen in Rust'sIterator
trait. Methods likechain
return a type that is onlyClone
ifSelf: Clone
andOther: Clone
.There's some discussion of this in the expanded
impl Trait
RFC, but I haven't seen any fully-fledged proposals for this yet.The text was updated successfully, but these errors were encountered: