Open Evian-Zhang opened 3 years ago
From the Rustonomicon, we should write robust unsafe Rust against wrong-implemented safe Rust.
However, from the doc I only know why we should write robust unsafe Rust, but not how we should write it.
I looked into the source code of BTreeMap, but it is so complicated that I could not find the answer.
BTreeMap
I posted this question in the forum, and we still could not get a clear code example.
I think this topic is generally good to go to https://rust-lang.github.io/unsafe-code-guidelines/introduction.html. Though it may be a good idea to add a link to there.
From the Rustonomicon, we should write robust unsafe Rust against wrong-implemented safe Rust.
However, from the doc I only know why we should write robust unsafe Rust, but not how we should write it.
I looked into the source code of
BTreeMap
, but it is so complicated that I could not find the answer.I posted this question in the forum, and we still could not get a clear code example.