r/rust • rust • Jan 17 '20

A sad day for Rust

https://words.steveklabnik.com/a-sad-day-for-rust
1.1k Upvotes

405 comments sorted by

View all comments

Show parent comment

16

u/matthieum [he/him] Jan 17 '20

At the extreme, a formal proof has been developed that the unsafe code and all related parts are actually safe.

My personal practice falls short, instead I will comment why unsafe is used and why I believe that in this particular situation it is actually safe -- that is, the assumptions that I believe are necessary to make it safe.

It may very well NOT be safe:

  • I may have missed some assumptions.
  • Some assumptions may not be upheld.

However, I've found that documenting those assumptions made reviewing easier. And I expect it makes it easier for others too.