You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we already have various mature bound constraint on associated type, there should be some bound constraint on associated const as well.
I also wonder how to design the syntax of associated const bound, since allowing any const expression in where clause may lead to hard parsing. Maybe a brace should be required?
The text was updated successfully, but these errors were encountered:
This is already possible in Nightly Rust today, by using const_generics and const_evaluatable_checked features as well as something analogous to C++'s std::conditional:
I recently post on rust forum about how to write constraint on associated const, and find out that there is no direct way to achieve this (even no RFC?).
For example, I have the following trait:
And I want to have constraint for that like
Since we already have various mature bound constraint on associated type, there should be some bound constraint on associated const as well.
I also wonder how to design the syntax of associated const bound, since allowing any const expression in where clause may lead to hard parsing. Maybe a brace should be required?
The text was updated successfully, but these errors were encountered: