JNI, com.sun.misc.Unsafe, etc
> In C# the hatch exists but can be reliably shut.
P/Invoke?
It's a tradeoff, of course: GC languages let you avoid unsafe code at the cost of doing GCs, which in some applications is an issue. Rust's stroke of genius is that it can avoid GCs while giving you almost all the safety of a GC language.
Overall I think it's safe (no pun intended) to say that Rust is significantly safer than C or C++, but slightly less safe than Java or C#. But of course both of those comparisons have lots of caveats and exceptions. And there are other factors than safety as well.
It's so complicated practically no one uses it.
> P/Invoke?
Can be disabled at VM level. Environments like asp.net classic default to partial trust, this ensures vast majority of third-party libraries aren't using p/invoke nor unsafe.
Some of these issues
> monomorphization
C++ language is equally bad, but there're well-known workarounds. If you don't abuse Alexandrescu-style, using compilation units, have sane architecture without God objects, it's often not too bad.
> macros
Not just any macros, macros who require multiple passes. C macros are single-pass and pretty efficient.
> build scripts
How that applies to C++?
> how many VMs don't have such escape hatches?
Java doesn't. In C# the hatch exists but can be reliably shut.
> its standard library is probably implemented in unsafe code
No, they don't.
http://www.docjar.com/html/api/java/util/ArrayList.java.html
https://source.dot.net/#System.Private.CoreLib/List.cs