Tagged pointers have been used for many years by large companies such as DragonflyDB. In some cases, it can be beneficial to save some memory by using tagged pointers. However, why doesn't Rust's standard library have this feature?
It is not because pointers are unsafe. Writing tagged references is not difficult. It seems that tagged pointers and references could be implemented in less than a thousand lines of code.
Let's consider an example. The operating system allows us to set 8-bytes data in some calls. In most cases, this is a pointer. We could use 8 bytes to store a tagged pointer, or we could use 8 bytes to represent a pointer to a structure that includes a pointer and some flags.
Yes, I do it. But let's imagine that each low-level software development team writes its own tagged pointers. This means not only the loss of development time (albeit a short time), but also the need for each team to support them.
There's a thread over on IRLO discussing how best to handle tag bits in pointers, along with some of the issues we face incorporating them into Rust's AM model.
You could make the same argument with any feature though. What makes tagged pointers so fundamental that they require support in the standard library as opposed to just a separate crate?