Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It’s never really going to be perfect e.g. your idea doesn’t really work with unsafe functions, which can only be called from unsafe contexts but also are an unsafe context.

`unsafe` in rust really means that some of the compiler guardrails are disabled:

* you can call unsafe (and extern) functions

* you can dereference raw pointers (this has significant consequences such as being able to create mutable references out of thin air)

* you can access or modify mutable statics

* you can access `union` contents



view as:

Legal | privacy