I've been using Rust for a little bit now, and in the process of trying to do more and more complicated things, I frequently 'battle the borrow checker'.
One question that recently crossed my mind, is if Rust also does some kind of 'Copy Elision', similar to what C++ does (it is required for C++ compilers to do this since C++17).
The idea in C++ is that if an object is returned by value from a function, that it is then not copied (or moved) when the function returns, but was created in the 'return' location of the function in the first place. (CPPreference can explain it better than I can; see here)
Is there a similar mechanism in place in Rust?