3 ms·
What he's saying is correct: all C/C++ code operates in semantics equivalent to Rust's "unsafe" blocks.
by msbarnett 10y ago
What he's saying is correct: all C/C++ code operates in semantics equivalent to Rust's "unsafe" blocks.
- wuch 10y agoGiven that in unsafe block you still have to uphold the same invariants as in other blocks of code, your job is actually much harder in Rust that it is in C/C++. Take a look at examples in [0], they would be perfectly valid in C/C++, but are potentially considered undefined behaviour in Rust. [0] http://smallcultfollowing.com/babysteps/blog/2017/02/01/unsafe-code-and-shared-references/ http://smallcultfollowing.com/babysteps/blog/2017/02/01/unsa...