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
Unresolved Questions
Feature gate:
#![feature(const_cmp_type_id)]This is a tracking issue for comparing
TypeIdin const items.Public API
Steps / History
TypeIdordering impls #101698Unresolved Questions
constprecludes some possible implementations, such as the one whereTypeIdincludes 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.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩