Allow bounds on all type parameters. by nrc · Pull Request #20 · rust-lang/rfcs (original) (raw)

@huonw That's an interesting point, but I think it actually means that default methods are also wrong in this world view. A simple fix is to remove them from the trait declaration and put them in a "default impl", where a type bound can be added just like a normal impl.

@nick29581 Well, it's clear that the current design is broken, and that it needs to be fixed either as this RFC suggest, or by removing bounds on traits and moving out default methods.

The logic of not having bounds on struct generic types is that it nicely separates data and traits and avoids having them on both structs and impls (on impls they are needed anyway, or expressiveness is lost).

The logic of having them is that it avoids having to repeat the bound everywhere, for bounds that will always be present on impls; also, if associated types are added, then you can have them bounded more easily.

Overall I think this RFC might be a good idea, but the reason should not really be "to fix trait bounds checking" (which can be done otherwise), but rather because we want to have bounds on structs and traits and not just impls.