Rellum Rellum

S0039: copy type contains non-copy field

Generated from rellum-diagnostics/src/db.rs.

Explanation

A record declared copy must be duplicable without transferring ownership. If any field is a Move type, such as String, Bytes, arrays, or a non-copy user-defined type, the record cannot be copied by value.

Common causes

Canonical fixes

Before:

type Packet = copy { payload: String }

After:

type Packet = { payload: String }

Before:

type Packet = copy { payload: String }

After:

type Packet = copy { code: Int }

Code example

type Packet = copy { payload: String }