#unsafe #escaping #memory-management

yanked unsafesc

A Rust package for running unsafe superpowers in a controlled environment

Uses old Rust 2015

0.0.2 Nov 14, 2018
0.0.1 Nov 6, 2018

#15 in #escape

22 downloads per month

MIT license

4KB

unsafesc

crates.io travis-ci.com

home https://github.com/realtable/unsafesc
docs https://docs.rs/unsafesc
cargo https://crates.io/crates/unsafesc
build https://travis-ci.com/realtable/unsafesc

Summary

The unsafesc library provides an interface to Rust's four "unsafe superpowers", namely:

  • dereferencing a raw pointer,
  • calling an unsafe function or method,
  • accessing or modifying a mutable static variable, and
  • implementing an unsafe trait

If you were using regular (safe) Rust you wouldn't be able to use any of these unsafe functions because they have been "locked away" by the compiler. Alternatively, unsafe Rust enables them, but you have to make sure all the unsafe code doesn't have any undefined behaviour. You can also only use unsafe code/functions within other unsafe functions.

The unsafesc package provides the best of both worlds, i.e. providing access to unsafe superpowers while taking care of undefined behaviour. It also unlocks these superpowers from implementation within just unsafe functions.

Installation

cargo install unsafesc

Usage

In its current form, unsafesc is a placeholder package. In future its features will all be implemented, but for now there aren't any.

No runtime deps