2 ms·
You don't know, but you can use a compiler flag that will tell you if you are. > I want my function to be marked as unsafe as well (because it is) This misund
by steveklabnik 12y ago
You don't know, but you can use a compiler flag that will tell you if you are.
> I want my function to be marked as unsafe as well (because it is)
This misunderstands the nature of `unsafe`. `unsafe` means "I promise that this is actually safe, even thought it can't be inferred." Take, for example, a type which has mutable, shared state, but enforces all access through a mutex[1]. This type presents a safe interface, but the compiler can't know that it's safe, so you have to use `unsafe` internally.
1: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html http://static.rust-lang.org/doc/master/std/cell/struct.RefCe...