| Crates.io | unsafe-to-verified |
| lib.rs | unsafe-to-verified |
| version | 1.0.2 |
| created_at | 2025-04-13 05:22:42.34011+00 |
| updated_at | 2025-04-13 05:39:12.200266+00 |
| description | Renames unsafe to verified (kinda) |
| homepage | |
| repository | https://github.com/lurkny/verified |
| max_upload_size | |
| id | 1631535 |
| size | 12,099 |
This simple proc macro was inspired by a tweet by HSVSphere, suggesting that the better name for unsafe was verified, which I totally agree with.
Unsafe carries a stigma, implying "dangerous" or "broken" when, in reality, it’s just Rust code that requires manual verification of certain invariants (e.g., memory safety, type correctness). By using verified, you’re highlighting the trust in the programmer’s diligence, which can make the code more approachable, especially in teams or projects where unsafe might scare off contributors.
To add unsafe to a function definition
#[verified_item]
pub fn some_unsafe_code()
Unsafe blocks within a function
pub fn unsafe_code_inside() {
verified!{
//do unsafe thing
}
}
Also works for impl blocks