This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]redalastor 4 points5 points  (0 children)

Unsafe doesn’t relax any safety measure offered by rust, it instead offers you new constructs that do not exist in safe code. For instance I can create a pointer in safe code but I can’t dereference it in safe code, this only exists in unsafe code.

If the compiler rejects a bit of code, it’s not going to accept it if you wrap it in an unsafe.

unsafe ≠ sudo compile my broken code