#safe #helping #less #programs #advisory #learn #security

macro plutonium

Tools to avoid unnecessary use of safe code

16 releases (4 breaking)

0.5.2 Aug 28, 2020
0.5.1 Aug 27, 2020
0.4.0 Jul 27, 2020
0.3.2 Jul 26, 2020
0.1.0 Feb 20, 2020

#8 in #advisory

28 downloads per month

MIT/Apache

13KB
144 lines

plutonium 🌑

plutonium unsafe forbidden

Helping you make your programs less safe.


lib.rs:

Helping you make your programs less safe.

You can learn more about plutonium at the Rust Security Advisory Database.

Usage

Add plutonium to your Cargo.toml:

[dependencies]
plutonium = "*"

and go:

use plutonium::safe;

#[safe]
fn super_safe(x: f32) -> i32 {
    std::mem::transmute::<f32, i32>(x)
}

#[safe]
unsafe fn deref_null() {
    *std::ptr::null::<u8>();
}

println!("{:?}", super_safe(1.0));
deref_null();

Roadmap:

  1. Disable #![forbid(unsafe_code)]
  2. Add #![forbid(safe_code)] proc-macro lint

Dependencies

~1.5MB
~37K SLoC