What
The code generator derives Copy on C-like #[repr(i32)] enums but never on structs, typedefs, or union enums - even when all their fields are Copy.
This means types like Hash, Uint256, PublicKey, AccountId, and MuxedAccount are Clone-only despite being small fixed-size values whose entire composition chain is [u8; 32] and other primitives.
Why
These types are frequently used in downstream code. Without Copy, every assignment, key construction, map lookup, or pattern-match extraction requires an explicit .clone(). In practice this leads to hundreds of gratuitous clone calls in any non-trivial Stellar Rust project.
Adding Copy is backward-compatible — existing .clone() calls continue to compile.
What
The code generator derives
Copyon C-like#[repr(i32)]enums but never on structs, typedefs, or union enums - even when all their fields areCopy.This means types like
Hash,Uint256,PublicKey,AccountId, andMuxedAccountareClone-only despite being small fixed-size values whose entire composition chain is[u8; 32]and other primitives.Why
These types are frequently used in downstream code. Without
Copy, every assignment, key construction, map lookup, or pattern-match extraction requires an explicit.clone(). In practice this leads to hundreds of gratuitous clone calls in any non-trivial Stellar Rust project.Adding
Copyis backward-compatible — existing.clone()calls continue to compile.