S0100: copy enum contains Move field
Generated from rellum-diagnostics/src/db.rs.
Explanation
A Copy type must be duplicable without heap allocation. If any variant contains a Move field (String, Bytes, arrays, or non-copy records), the enum as a whole owns heap data and cannot be Copy.
Common causes
- adding a String field to a variant of a
copy enum - using an array type in a variant payload
Canonical fixes
- remove
copyto make the enum Move
Before:
copy enum Foo = Bar { name: String }
After:
enum Foo = Bar { name: String }
- change the Move field to a Copy type
Before:
copy enum Foo = Bar { name: String }
After:
copy enum Foo = Bar { code: Int }
Code example
copy enum Foo = Bar { name: String }