#safe #helping #less #programs #learn #advisory #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

Download history 19/week @ 2024-04-01 3/week @ 2024-04-08 1/week @ 2024-04-15 6/week @ 2024-04-22 17/week @ 2024-05-20 16/week @ 2024-05-27 14/week @ 2024-06-03 16/week @ 2024-06-10 8/week @ 2024-06-17 8/week @ 2024-06-24 135/week @ 2024-07-01 7/week @ 2024-07-08 8/week @ 2024-07-15

159 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
~35K SLoC