In high-quality C and C++ projects, about 70% of vulnerabilities are caused by memory errors. (https://alexgaynor.net/2020/may/27/science-on-memory-unsafet...)
It is to be expected that there is no bug in the very thing that Rust is supposed to prevent. The same can be said of Java, JS or even PHP. What surprises me a little though is that there is zero memory error even in unsafe Rust. There has to be some unsafe code somewhere, for low level data structures and things like that.
Even unsafe Rust has more strict typing and borrow checking which C++ doesn't have. It does allow raw pointers, but it's still safer than C++.
The other thing is that if say 1% of your loc is unsafe Rust, it's much easier to put this under more scrutiny than the whole C++ codebase.
And 1% is a lot if you ask me. I almost never need unsafe at all.
>There has to be some unsafe code somewhere, for low level data structures and things like that.
In most cases you can just use the standard library code for these. They do contain unsafe of course, but it's in one of the most battle tested places.
However memory errors in C++ account for 70% of vulnerabilities. I'd expect 30% to thus remain.
Edit: meant to write memory errors not vulns.
The good thing is that since this code was written in a memory safe language, at least that eliminates an entire class of bugs.