#trusted #unsafe #tell #compiler #write

trustme

Tell the compiler that you can be trusted to write unsafe code!

2 stable releases

1.0.1 Jul 2, 2023

#693 in Programming languages

MIT license

2KB

trustme

Tell the compiler that you can be trusted!

use trustme::*;

fn main() {
    let mut x: i32 = 0;
    let ptr = (&mut x) as *mut i32;
    trustme! {*ptr = 42};
    println!("{x}");
}

lib.rs:

Tell the compiler that you can be trusted. No more errors about unsafe code - just tell the compiler to trust you via the trustme macro and it will get off your nerves!

No runtime deps