2 ms·
It's... fine. It's got some issues though. Like: > Since Unsafe Rust may modify an arbitrary memory location, any use of Unsafe Rust in any dependency compromi
by steveklabnik 6y ago
It's... fine. It's got some issues though. Like:
> Since Unsafe Rust may modify an arbitrary memory location, any use of Unsafe Rust in any dependency compromises the static guarantees of the whole library
With this definition, literally every Rust program is not safe, because:
1. Most operating systems don't have syscalls written in Rust, so doing anything at all ends up needing unsafe.
2. Even if you wrote an OS with safe syscalls, doing things with the hardware is going to require unsafe.
So, buried somewhere in there, unsafe will exist. So I don't personally think this definition makes a lot of sense.
To me personally, comments like this are more interesting, and tell a different story:
> The number of unsafe blocks per crate is small for the majority of the crates, more than 90% of the crates have fewer than ten unsafe blocks
This validates one of Rust's core propositions, IMHO. From eyeballing the graph, it seems that ~70 of crates have zero unsafe? Very interesting.