At one point it was found these every keypress on the OmniBar resulted in 25,000 string copies.
So my point is that you can write C++ as carefully as you can but on any sufficiently complex code base you'll going to need a pointer to something and then you've really lost all control and safety so the safety in C++ is a bit of an illusion.
The right thing (TM) would probably be to refactor some of the std::string's into std::string_view's, for instance by adding overloads where it makes sense. I doubt you could avoid all the copies, but I think you could cut it down substantially if you collected metrics and focused on the most egregious cases.
Of course, I do not envy the person who is tasked with doing that, and I could be wrong for any number of arcane technical reasons.
In the end they did a number of things to fix this, the patches are linked in the story I linked above.
std::string_view has seemed, to this relative outsider, to be semi-controversial. It makes it pretty easy to introduce use after frees, that it's not null terminated can be easy to forget, and isn't bounds checked. So while it helps with some issues, it can create others, meaning it's not always a clear win.
The borrow checker is one of the benefits of Rust in that case, simply because you can avoid copies while actually being able to trust that you're not opening the door to security & maintenance hell in the process.
When you run Coverity or other static analyzer on your code, how many violations do you find? How many were unexpected?
The borrow checker is always being run - the difference is whether its in the compiler (Rust) or you in your head (C++). And I trust the compiler much more than I trust myself...
You get to write code that's just as or more performant, and you get to jettison the decades of bad language design that is C++, which is win/win to me.
https://github.com/iced-rs/iced
My general point though is that there's still some ecosystem/legacy reasons to stick with C++, but Rust very much fills the same niches as C++.
I use C++ because I want performance without all the accounting operations that have to happen in C. I try to write my code in a safe way, but language safety just isn't a priority for me. I guess that's why I'm not using Rust. Fighting the borrow checker doesn't seem worth it to me to gain something that's just not that much of a priority. But I'm not writing an OS or a server.
I'd think of Rust more like a better Ada or some language where safety is first priority