3 ms·
You need unsafe in Rust just to do a doubly-linked list.
by wvenable 6y ago
You need unsafe in Rust just to do a doubly-linked list.
- tene 6y agoYes, I agree, you can implement a doubly-linked list in Rust exactly as you can in C, with the same precise control. You can even implement intrusive collections: https://docs.rs/intrusive-collections/ https://docs.rs/intrusive-collections/ Unsafe is a normal part of the language, and how you manually implement precise control behind a safe reusable abstraction whose correct use can be verified by the compiler. Do you have any examples of precise control you can express in C, but can't express in Rust?
- a1369209993 6y ago> You need unsafe in Rust just to [implement] a doubly-linked list. And? That's what unsafe is for.