We can't expand the span of the error reliably according to @oli-obk, so
just mention why it points to this particular expression.
RemainderByZero => "attempt to calculate the remainder with a divisor of zero",
GeneratorResumedAfterReturn => "generator resumed after completion",
GeneratorResumedAfterPanic => "generator resumed after panicking",
- InfiniteLoop => "program will never terminate",
+ InfiniteLoop =>
+ "duplicate interpreter state observed while executing this expression, \
+ const evaluation will never terminate",
}
}
}
LL | | let mut n = 113383; // #20 in A006884
LL | | while n != 0 { //~ ERROR constant contains unimplemented expression type
LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
- | | ---------- program will never terminate
+ | | ---------- duplicate interpreter state observed while executing this expression, const evaluation will never terminate
LL | | }
LL | | n
LL | | }];