Is unsafe Rust worse than C?
โ Rust ๐ 2026-05-27 ๐ค surdeus ๐๏ธ 1I've been thinking of migrating from C to Rust, but with unsafe Rust I can't see much benefit as it's much less well defined than C from what I can see.
Looking at Behavior considered undefined - The Rust Reference :
The following list is not exhaustive; it may grow or shrink. There is no formal model of Rustโs semantics for what is and is not allowed in unsafe code, so there may be more behavior considered unsafe.
Breaking the pointer aliasing rules. The exact aliasing rules are not determined yet, but here is an outline of the general principles
Violating assumptions of the Rust runtime. Most assumptions of the Rust runtime are currently not explicitly documented.
There's not many guides online about how to write unsafe Rust either, mostly 'it's really hard and you shouldn't do it'.
10 posts - 5 participants
๐ท๏ธ Rust_feed