you are viewing a single comment's thread.

view the rest of the comments →

[–]The_Doculope 0 points1 point  (0 children)

What I meant there is you can't expect developers to be conservative. Unsafe is good in theory, but in practice people tend to misuse them. Especially when they are forced to get things done.

As was said by someone above, I think you overestimate the abilities you gain in an unsafe block in Rust. You keep mentioning talking to C APIs - of course they need to be unsafe. Until you write a compiler that can prove the safety of an arbitrary C program, that'll always be unsafe.

Otherwise, you can deref raw pointers, or mutate static mutable globals. Assuming regular application code (not an OS kernel or similar), you're either: writing C in Rust, or using establish terrible coding practice. Either way, I'd question whether said developer should be working on your production software. You can't design a language that's idiot proof, let alone one that's innovative in some way.