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
Auto merge of #142789 - oli-obk:constable-type-id, r=<try>
Make TypeId const comparable
This should unblock stabilizing const `TypeId::of` and allow us to progress into any possible future we want to take `TypeId` to.
To achieve that `TypeId` now contains `16 / size_of<usize>()` pointers which each are actually just `size_of<usize>()` bytes of the stable hash. At compile-time the first of these pointers cannot be dereferenced or otherwise inspected (at present doing so might ICE the compiler). Preventing inspection of this data allows us to refactor `TypeId` to any other scheme in the future without breaking anyone who was tempted to transmute `TypeId` to obtain the hash at compile-time.
cc `@eddyb` for their previous work on #95845 (which we still can do in the future if we want to get rid of the hash as the final thing that declares two TypeIds as equal).
* #77125
r? `@RalfJung`
0 commit comments