Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 26d0eeb

Browse files
authored
Merge pull request #707 from ubsan/patch-1
POD -> trivially copyable
2 parents ebf86de + 120b9ea commit 26d0eeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

en-US/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ impl Foo {
15201520
Does Rust have copy constructors?
15211521
</a></h3>
15221522

1523-
Not exactly. Types which implement `Copy` will do a standard C-like "shallow copy" with no extra work (similar to "plain old data" in C++). It is impossible to implement `Copy` types that require custom copy behavior. Instead, in Rust "copy constructors" are created by implementing the `Clone` trait, and explicitly calling the `clone` method. Making user-defined copy operators explicit surfaces the underlying complexity, making it easier for the developer to identify potentially expensive operations.
1523+
Not exactly. Types which implement `Copy` will do a standard C-like "shallow copy" with no extra work (similar to trivially copyable types in C++). It is impossible to implement `Copy` types that require custom copy behavior. Instead, in Rust "copy constructors" are created by implementing the `Clone` trait, and explicitly calling the `clone` method. Making user-defined copy operators explicit surfaces the underlying complexity, making it easier for the developer to identify potentially expensive operations.
15241524

15251525
<h3><a href="#does-rust-have-move-constructors" name="does-rust-have-move-constructors">
15261526
Does Rust have move constructors?

0 commit comments

Comments
 (0)