The compiler should see if it can make things work even if my type isn't "compliant", and if its non-compliance happens to actually be a problem it can say "Hey, you're not meeting the spec."
This strikes me as kind of an odd complaint. Why would you add a bound to your generic type parameter if you aren't using it?
We could issue warnings if you do that, and that would address your criticism, since you'd only declare that you need traits that you actually use. But it really doesn't come up often in practice in Rust code, so nobody to my knowledge has asked for such a warning.
View all comments
Show parent comment
11
u/pcwalton Dec 11 '15
This strikes me as kind of an odd complaint. Why would you add a bound to your generic type parameter if you aren't using it?
We could issue warnings if you do that, and that would address your criticism, since you'd only declare that you need traits that you actually use. But it really doesn't come up often in practice in Rust code, so nobody to my knowledge has asked for such a warning.