unsafe is a keyword in Rust, function calls and operations where the compiler cannot ensure that the code is UB-free (eg. raw pointer dereference) must be put in unsafe { expression; } blocks.
The whole point of Rust is that for most of the things unsafe is not needed. Main exceptions are FFI calls, compiler intrinsics and array accesses without (the otherwise by-default) bound-checks.
When it comes to crates (Rust packages), yes, people put tags on them regarding unsafe use, but mostly from the other viewing angle, advertising them as having zero unsafe code.
I'm familiar with the phrase. It just reminded me of a scene in a manhua that I felt relevant when discussing nasal demons. But thanks for the link, since anyone else unfamiliar can enjoy understand.
59
u/diavolo_bossu Jul 01 '22
Ub?
56
u/riasthebestgirl Jul 01 '22
unsafe { *std::ptr::null() }6
u/ObserverOfVoid Jul 02 '22
4
u/-Redstoneboi- Jul 02 '22
and in both cases you are very much recommended to stay away from the unsafe tags unless you know what you're doing.
1
u/Electronic-Bat-1830 Jul 27 '23
I'm learning about unsafe C#.
2
u/[deleted] Jul 03 '22
[removed] — view removed comment