External Publication
Visit Post

Stable type identifiers: a missing piece for crABI and export

Rust Internals [Unofficial] March 19, 2026
Source
I understand the DefPath issue. I’ll see if I can look into this further. Thinking about this, I wonder if the solution might be to separate the type’s identity from its layout. Would it be feasible to use a 128-bit identifier split into two parts? The first part would be for the stable path (the crate name and the type’s path), which wouldn’t change. The second part would be like a fingerprint of the layout (only the published structure and the types of the fields). With 128 bits, we’d have enough space—we’d even have some left over for both things without the risk of collisions. This way, the identifier wouldn’t just tell us what type it is, but it would also let us know if its structure has changed. Do you think this kind of approach will help resolve the sensitivity you mentioned regarding DefPath?

Discussion in the ATmosphere

Loading comments...