arrayvec icon indicating copy to clipboard operation
arrayvec copied to clipboard

Safety documentation

Open aticu opened this issue 5 years ago • 0 comments

I've developed a crate for my bachelor's thesis to make working with unsafe code a little bit safer. It works by annotating unsafe functions with the preconditions that need to be upheld for their safety. A call to an annotated function will fail to compile, unless it is assured at the call site that the preconditions hold. Assuring this uses another attribute at the call site.

Here is the link to the crate: https://github.com/aticu/pre.

If you'd be willing to give it a try, I'd be happy to prepare a pull request to integrate its usage into arrayvec where possible. While adding it, I'd also audit the unsafe usage of arrayvec. Since the crate is not yet 1.0 and you don't want non-1.0 dependencies, I'd add it as a dev-dependency, so these checks are only performed in test builds.

If you're not interested, I'd appreciate it if you could briefly let me know why, as that will be valuable feedback for my thesis.

aticu avatar Jul 16 '20 11:07 aticu