-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support constants in const eval #11772
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! We should really start having a proper test suite for this though.
I didn't find out how to find the ConstId of the implementation of the trait, not the trait itself (possibly related to #4558 ? We can find associated type alias, so maybe this is doable already)
That's exactly that issue. And yes, it's very similar to normalizing type aliases, but Chalk can't do it for functions or consts yet.
bors d+
✌️ HKalbasi can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
This PR enables evaluating things like this:
My target was nalgebra's
U5
,U22
, ... which are defined astype U5 = Const<{ SomeType5::SOME_ASSOC_CONST }>
but I didn't find out how to find theConstId
of the implementation of the trait, not the trait itself (possibly related to #4558 ? We can find associated type alias, so maybe this is doable already) So it doesn't help for nalgebra currently, but it is useful anyway.