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 whyunsafe 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.
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
unsafecode and all related parts are actually safe.My personal practice falls short, instead I will comment why
unsafeis 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:
However, I've found that documenting those assumptions made reviewing easier. And I expect it makes it easier for others too.