3 ms·
You can do these things safely, you just can't do them safely and efficiently at the same time. You could do a doubly linked list with reference counting, and i
by steveklabnik 6y ago
You can do these things safely, you just can't do them safely and efficiently at the same time. You could do a doubly linked list with reference counting, and it would be in safe code, it just wouldn't be classic implementation you'd be imagining, and not as efficient.
- worik 6y agoYou can do circular structures like doubly linked lists in Rust. You can do them efficiently. But you do need to use "unsafe". Of course you do, a moments thought shows you why. It is not as "safe" as Rust without "unsafe" blocks, but it is still reasonably safe. But circular structures are usually a bad choice.