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:
parent
d36302da53
commit
647ba29b90
@ -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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 | | }];
|
||||
|
Loading…
Reference in New Issue
Block a user