I'm playing around with const generics on nightly and am running into a weird error that I don't really understand. A minimal example would be the following:
According to the design document, you need to "mention" some type containing 2*N in e.g. a where bound in order to be able to use it. As far as my understanding goes, intuitively this could be useful because:
Vector<T, N> is only a valid type whenever 2*N does not overflow
Having this constraint be implicit would implicitly expose the fact that the type Vector contains something using 2*N. (And lead to breaking changes more easily.)
The document also mentions the current way to make this kind of type work: adding a where bound mentioning the expression, without any constraints