-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.