| Crates.io | trustmebro-macro |
| lib.rs | trustmebro-macro |
| version | 0.1.0 |
| created_at | 2025-11-18 20:09:02.849447+00 |
| updated_at | 2025-11-18 20:09:02.849447+00 |
| description | A macro that wraps arbitrary tokens in an unsafe block |
| homepage | |
| repository | https://github.com/tristanpoland/TrustMeBro |
| max_upload_size | |
| id | 1938955 |
| size | 5,494 |
A Rust macro that wraps arbitrary tokens in an unsafe block. Because sometimes you just need the compiler to trust you.
Add this to your Cargo.toml:
[dependencies]
trustmebro = "0.1.0"
use trustmebro::trustmebro;
let mut x = 5;
let ptr = &mut x as *mut i32;
trustmebro! {
*ptr = 10;
}
assert_eq!(x, 10);
This macro is a humorous way to write unsafe blocks. Instead of:
unsafe {
// dangerous code here
}
You can write:
trustmebro! {
// dangerous code here
}
This macro provides no additional safety guarantees. It simply wraps your code in an unsafe block. Use responsibly and ensure you understand Rust's safety requirements when working with unsafe code.
Licensed under either of:
at your option.