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
I am trying to commit const fn crimes with Facet, and got stuck on type_eq() not being const. I understand that this might be annoying to implement since PartialEq::eq isn't const yet, but being able to dispatch on type in const fns would be very useful, so it may be worth investigating.
The text was updated successfully, but these errors were encountered:
Okay, so you can't make it work. The whole trick behind const TypeId is that it's actually grabbing the pointer and only evaluating it, or calling the function pointer that returns the TypeId when you're actually doing anything with it, like comparing it. So it actually relies on PartialEq not being const.
I suppose it could work on nightly only? but I'm really hesitant to step it into nightly territory because I have been trying very hard to make everything work on stable.
I tried nightly's "const_type_id" feature briefly and if it stabilizes, we're still blocked on requiring T: 'static, which locks us out of, for example, Vec<&str>
I am trying to commit const fn crimes with Facet, and got stuck on type_eq() not being const. I understand that this might be annoying to implement since PartialEq::eq isn't const yet, but being able to dispatch on type in const fns would be very useful, so it may be worth investigating.
The text was updated successfully, but these errors were encountered: