Re:Why the developers who use Rust love it so much
by ChrisSD on Saturday June 06, 2020 @06:25AM
(#23438153)
Implicit clones are enabled using the `Copy` marker trait in Rust.
Re:Why the developers who use Rust love it so much
by zozbot234 on Saturday June 06, 2020 @06:44AM
(#23438228)
`Copy` implies that an object can be bitwise copied while preserving desired semantics; Rust has no exact equivalent to copy construction or move semantics in C++, which can be entirely implicit while involving custom code. (There's a 3rd-party `transfer` crate that enables a `Clone`-like marker for custom moves, however. It's used together with the Pin feature, so these moves are also explicit.)
In C++ you can write a natural-feeling library that provides familiar arithmetic. In Rust, you will be constantly smacked in the face with lifetimes, borrowing, etc. because there's no way to do implicit clones or borrows.