Open
Description
Feature gate: #![feature(const_cmp_type_id)]
This is a tracking issue for comparing TypeId
in const items.
Public API
impl const PartialEq for TypeId {}
impl const PartialOrd for TypeId {}
impl const Ord for TypeId {}
Steps / History
- Implementation: Constify
TypeId
ordering impls #101698 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Making these
const
precludes some possible implementations, such as the one whereTypeId
includes a pointer to a static as proposed in TypeId: use a (v0) mangled type to remain sound in the face of hash collisions. #95845. This const-ness should not be stabilized without an explicit decision that we never want such an implementation.raldone01: I don't think adding a
'static
pointer would be a problem as the contents of the pointer would be compared and not the pointer addresses.