CARDIAC › rust-cardiac › Message codes › RCE0031
RCE0031error
A phase that reaches into another.
error[RCE0031]: phase {phase} ends at more than one overlay()
error[RCE0031]: phase {phase} jumps to {to}, in another phase
A phase whose code goes on into another phase other than through its overlay().
Only one phase's code is in memory at a time. A phase has to end at one overlay(), and nothing in it may jump to code of another phase, which isn't there. An overlay() in one arm of an if and another in the other arm, or a loop that crosses an overlay(), breaks that.
Place each overlay() where every path through main passes it once.
fn main() {
let a = inp();
let b = if a < 0 { -a } else { a };
overlay(); // after the if, not in its arms
out(b);
}
In a terminal: cargo cardiac help RCE0031.