Woah, today I learned that Rust has a doubly linked list in its standard library!
It's a common example of something you can't do in purely safe Rust. Nonetheless, the core Rust devs have done the hard work already!
Is there any way of doing tagged references in safe Rust?
I've been looking at tagged pointers (the crate https://docs.rs/tagged-pointer/latest/tagged_pointer/ looks excellent) but it gives you back a raw pointer.
I'm not sure if you can create a safe wrapper for references using tagged pointers.
My Rust rule of thumb: if there are no lifetimes in your return type, you probably don't need to specify the lifetimes in your arguments.
(I know clippy will point out simple cases of unnecessary lifetimes, but plenty other cases occur IME.)