Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Possible to implement recursive data structures in safe Rust?
In my learning experience I can not figure out how to implement basic data structures like Single Linked Lists, Binary Trees or Directed Graphs in safe Rust. Especially for element removal operations I have had to resort to unsafe Rust. Either directly with unsafe
block or indirectly with standard library auxiliary functions like mem::take
or mem::replace
. All due to borrow checker prevented have two mutable accesses to the same instance.
I'm curious if there is any implementation of some of above DS which does not require unsafe Rust?
4 posts - 4 participants
🏷️ Rust_feed