Explain reason behind error span

We can't expand the span of the error reliably according to @oli-obk, so
just mention why it points to this particular expression.
This commit is contained in:
Dylan MacKenzie 2018-06-26 18:54:59 -07:00
parent d36302da53
commit 647ba29b90
2 changed files with 4 additions and 2 deletions

View File

@ -399,7 +399,9 @@ pub fn description(&self) -> &str {
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",
}
}
}

View File

@ -29,7 +29,7 @@ LL | | //~| ERROR could not evaluate repeat length
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 | | }];