-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q.: Would pinning enable circular doubly-linked lists? #61
Comments
Yes, the design of this crate predates Pinning a |
Wouldn't that still violate Rust's aliasing rules? (if, say, a raw pointer is used - must be used? - to change the interior of the object while a |
That's a good point. I'm not actually sure since I'm not too familiar with the exact rules on |
I read this after Amanieu posted the link to the larger discussion. However, tokio doesn't use circular lists at this time, so there is an additional problem, I think. The immediate problem I've been encountering with my early attempts at implementing a circular linked list is that while it works when I use raw pointers throughout (as it should), it starts failing when I try to keep the collection head/tail in a Rust object and use Rust-style methods that take When the last element of a list is removed and the circular list is in a state where tail.prev points to the head and head.next points to the tail, the compiler will assume that the address of I think that at this point I'm looking for the mystical |
In DESIGN.md you write
This document was written 4 years ago. Was that before
std::pin
was introduced?If so (here's my question) would circular lists be possible if the collection were guaranteed to be pinned?
Would that be a meaningful approach to enable circular lists?
The text was updated successfully, but these errors were encountered: