logoalt Hacker News

steveklabnikyesterday at 7:05 PM1 replyview on HN

Depending on exactly what you mean, this isn't correct. This syntax is the same as <T: BarTrait>, and you can store that T in any other generic struct that's parametrized by BarTrait, for example.


Replies

marcosdumayyesterday at 10:47 PM

> you can store that T in any other generic struct that's parametrized by BarTrait, for example

Not really. You can store it on any struct that specializes to the same type of the value you received. If you get a pre-built struct from somewhere and try to store it there, your code won't compile.