diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index 143b7b2069cc..68e1d6c65c06 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -399,7 +399,9 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> { 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", } } } diff --git a/src/test/ui/const-eval/infinite_loop.stderr b/src/test/ui/const-eval/infinite_loop.stderr index 904fbcb07e4b..95c15c3e4e25 100644 --- a/src/test/ui/const-eval/infinite_loop.stderr +++ b/src/test/ui/const-eval/infinite_loop.stderr @@ -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 | | }];