Closed
Description
The nodes in LinkedList
look like this:
struct Node<T> {
next: Option<Box<Node<T>>>,
prev: Option<Shared<Node<T>>>,
value: T,
}
Box
uses Unique
, which requires that it "the referent of the pointer should not be modified without a unique path to the Unique reference". This effectively means that Unique
doesn't allow aliases, but this rule violated by the prev
pointer which point to the same node as a Unique
.
While Rust currently doesn't give noalias
semantics to Unique
, this is planned in the future and will silently break LinkedList
.