-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no place to add evaluatable bounds to assoc const items #104400
Comments
Hmm, yeah. Associated constants cannot have a where clause (contrary to types and functions) and thus the suggestion is incorrect. And adding the where clause to the trait itself would lead to a cycle error. Labeling this as a diagnostic issue for now but I think at some point we need to allow where clauses on associated constants. @rustbot label C-bug T-compiler A-diagnostics F-generic_const_exprs |
Hi @fmease, do you suggested that the code
cannot be done by now by using |
I am afraid so. |
#![feature(generic_const_exprs)]
evaluatable { Self::ASSOC }
to assoc const items
evaluatable { Self::ASSOC }
to assoc const items
@psionic12 In the coming days & weeks I'm going to work on implementing generic parameters & where clauses on free & associated const items. |
Not sure if a new issue is warranted, but even with
which gives error:
|
The issue you are describing is #107874 (except that the where-clause is on an impl not a trait but that is irrelevant). |
Example:
The compiler will report an error:
Honestly speaking, I don't get what the suggestion means. Is it allowed to use generic_const_exprs like this? Or the only way to do this is by writing
?
The text was updated successfully, but these errors were encountered: