News for hackers. Stuff that matters.
Re:C++'s Rule of Zero by dbaupp on Sunday June 28, 2015 @04:59PM (#9795070)
u = v is always the same thing in Rust: semantically a shallow byte copy ala memcpy (although there may not actually be a byte-by-byte copy at runtime, due to optimisations etc.). Whether a type moves or copies doesn't change this, it only influences whether v is usable (statically checked) after the assignment: the worst that happens if you don't know what type they are is a compile error talking about "use of moved value" (which also points to exactly the place that did the move).

The `Copy` trait (types that don't move) is just for types where memcpy is a valid & safe way to duplicate values of those types, it's not at all like C++'s custom copy constructors.

See also my answer here: http://stackoverflow.com/a/24253573/1256624

There are no comments on this comment yet.