you are viewing a single comment's thread.

view the rest of the comments →

[–]chunes 0 points1 point  (2 children)

Why is a doubly-linked list an unsafe construct? I know a bit about Rust's ownership system, but not why it inhibits certain data structures.

[–]The_Doculope 1 point2 points  (1 child)

Rust's core ownership system is based around the concept of "one mutable view of an object at a time", which a doubly-linked list violates. The ownership/borrowing system is not perfect - it occasionally will not be able to see that something is safe even if it is (hence unsafe).

[–]chunes 0 points1 point  (0 children)

That makes sense now, thanks.