There are quite a few cases where people say "Rust wouldn't have fixed" this and they're a real mixed bag of whether that's right or wrong or hard to say, partly because in fact Rust's safety culture isn't just about memory safety.
So e.g. there are some logic bugs where you're like yeah, I'd totally write that same bug in Rust but there are also arithmetic bugs where the problem arises because C++ inherits C's um, exciting "integer promotion" rules and Rust doesn't have those, far more of such situations in a Rust codebase are going to cause a puzzled programmer to investigate what really is going on with these integers and not write the bug.
Or there are type safety bugs where in Rust that mistake just won't compile, but in C++ it will compile it just has astonishing results. Obviously you can't write those bugs in Rust.
There's also a lot of contribution from ergonomics considerations where Rust's "Empowering everyone" idea means they think about library and feature design not just from the perspective of an expert but also a beginner, someone learning or maybe familiar with the rest of the language but not this particular feature. In C++ sort() is the unstable sort, if you don't know what unstable sorting is, you're given no clue that this might have consequences which astonish you. In Rust that sort is still there, but it's named sort_unstable() -- cuing a novice to read up about this idea before they are surprised. If they just write sort() they get a stable sort instead.
So e.g. there are some logic bugs where you're like yeah, I'd totally write that same bug in Rust but there are also arithmetic bugs where the problem arises because C++ inherits C's um, exciting "integer promotion" rules and Rust doesn't have those, far more of such situations in a Rust codebase are going to cause a puzzled programmer to investigate what really is going on with these integers and not write the bug.
Or there are type safety bugs where in Rust that mistake just won't compile, but in C++ it will compile it just has astonishing results. Obviously you can't write those bugs in Rust.
There's also a lot of contribution from ergonomics considerations where Rust's "Empowering everyone" idea means they think about library and feature design not just from the perspective of an expert but also a beginner, someone learning or maybe familiar with the rest of the language but not this particular feature. In C++ sort() is the unstable sort, if you don't know what unstable sorting is, you're given no clue that this might have consequences which astonish you. In Rust that sort is still there, but it's named sort_unstable() -- cuing a novice to read up about this idea before they are surprised. If they just write sort() they get a stable sort instead.