CARDIAC › rust-cardiac › Message codes › RCE0004
RCE0004error
A type no cell holds.
error[RCE0004]: unsupported local type {ty} for {local} (this backend has u8, i16, usize and bool)
error[RCE0004]: {f}: field {k} of {s} is {t}: fields must be scalars, structs or arrays of scalars
error[RCE0004]: {p}: a field of a type with no values
error[RCE0004]: {p}: a field of type ()
error[RCE0004]: enum {e}: field {k} of {variant} is {t}: the fields of an enum's variants must be scalars (i16, u8, usize, bool), enums, structs or arrays of scalars for now
A value of this type can't be kept in CARDIAC's cells.
A cell holds a sign and three digits, -999 to 999. The types that fit are i16, u8, usize and bool (and i8), one cell each, and what is built of them: arrays, structs, tuples and enums. Floating point, the wide integers (i32 and up, when a value of one is kept), and anything on the heap have no cell.
Use the card's own types. An i16 holds every value a card can.
// refused: a float
let half: f32 = 0.5;
// compiles: the value in hundredths, on a card
let half: i16 = 50;
In a terminal: cargo cardiac help RCE0004.