| > C# is not more safe than Rust By design, Rust requires unsafe code to implement any non-trivial data structures (except trivial POD types). This applies to both Rust standard library, and third-party crates. The issue is not a theory, security bugs actually happened in reality. Here’s an example about the Rust standard library: https://shnatsel.medium.com/how-rusts-standard-library-was-v... By contrast, thanks to the VM and the GC, C# allows to implement very complicated data structures without any unsafe code or unmanaged interop. The standard library is also implemented in idiomatic memory-safe subset of the language. For example, here’s the hash map: https://source.dot.net/#System.Private.CoreLib/src/libraries... > falls to prevent null pointer exceptions and modified collection exceptions Yes indeed, but these exceptions are very unlikely to cause security bugs in the software. |
That seems like a gross overstatement.
https://github.com/rust-lang/rust/blob/master/library/std/sr...
CTRL-F: unsafe
Only one result, an optional utility function: "pub unsafe fn get_many_unchecked_mut"