Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Copy trait

Types whose values are copied, not moved, on assignment.

Copy types (integers, bool, char, &T, ...) are duplicated bit for bit on assignment; the source stays usable.

Loading interactive…

Examples

  • let b = a; with a: i32 copies the number, so a and b are both still usable; a tuple of integers behaves the same way.

Read the full section →