In @rustlang is there any way to constrain an associated type in a where clause? Are where clauses fully documented anywhere?
@carllerche @rustlang hm but if I have a bound like T: Add, can I express constraints on Add::Output? (eg, that it's T?)
-
-
@avibryant You would do: `T::Output: Bound` (i believe) -
.
@carllerche aha, turns out I wanted `where T: Add<Output=T>`. Glad it's possible; looking forward to better docs :) -
@avibryant Ah, cool. Yeah, that pins the associated type to a concrete implementation vs. setting a bound. -
@carllerche I'm still getting my head around when associated types help vs. type params on the trait. Not quite the same as in Scala. -
@avibryant Yeah, it's different :)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.