Earlier quoted context omitted.
I found the copy/move situation in Rust to be far less intuitive than in C++. In C++, move semantics are obvious because they rely on std::move and the && operator, whereas in Rust, similar behavior seemed to depend on the object type. Even more confusingly, Rust has its own move operator as well, despite destructive move being the default behavior for assignment. I found it frustrating enough that I put the language…
> In C++, move semantics are obvious because ... In Rust it's also obvious because every = is a move. Confusion comes from tutorials pretending for too long that it's not. > whereas in Rust, similar behavior seemed to depend on the object type. It's best to think of that as an exception to the rule created specifically for numbers and other similar small, cheaply copied things. If you need to move `a` but `a` has a t…
> In Rust it's also obvious because every = is a move.
False, depending on the presence of an explicit type annotation on the left-hand side, an = triggers either a move or a reborrow.