Rellum Rellum

S0038: cyclic user-defined type

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

Explanation

User-defined records and enums are stored by value. A direct cycle between named types would require a value to contain itself with no finite size, so the compiler rejects cyclic type definitions.

Common causes

Canonical fixes

Before:

type Node = { next: Node }

After:

type Node = { next_id: Int }

Code example

type Node = { next: Node }