Shorten error message and add link to test
Implements @bjorn3's suggestions.
This commit is contained in:
parent
0d0e021b1c
commit
c395044a50
@ -400,8 +400,7 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
|
||||
GeneratorResumedAfterReturn => "generator resumed after completion",
|
||||
GeneratorResumedAfterPanic => "generator resumed after panicking",
|
||||
InfiniteLoop =>
|
||||
"duplicate interpreter state observed while executing this expression, \
|
||||
const evaluation will never terminate",
|
||||
"duplicate interpreter state observed here, const evaluation will never terminate",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ fn main() {
|
||||
let _ = [(); {
|
||||
//~^ WARNING Constant evaluating a complex constant, this might take some time
|
||||
//~| ERROR could not evaluate repeat length
|
||||
let mut n = 113383; // #20 in A006884
|
||||
let mut n = 113383; // #20 in https://oeis.org/A006884
|
||||
while n != 0 { //~ ERROR constant contains unimplemented expression type
|
||||
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ LL | let _ = [(); {
|
||||
| __________________^
|
||||
LL | | //~^ WARNING Constant evaluating a complex constant, this might take some time
|
||||
LL | | //~| ERROR could not evaluate repeat length
|
||||
LL | | let mut n = 113383; // #20 in A006884
|
||||
LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
|
||||
... |
|
||||
LL | | n
|
||||
LL | | }];
|
||||
@ -26,10 +26,10 @@ LL | let _ = [(); {
|
||||
| __________________^
|
||||
LL | | //~^ WARNING Constant evaluating a complex constant, this might take some time
|
||||
LL | | //~| ERROR could not evaluate repeat length
|
||||
LL | | let mut n = 113383; // #20 in A006884
|
||||
LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
|
||||
LL | | while n != 0 { //~ ERROR constant contains unimplemented expression type
|
||||
LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
|
||||
| | ---------- duplicate interpreter state observed while executing this expression, const evaluation will never terminate
|
||||
| | ---------- duplicate interpreter state observed here, const evaluation will never terminate
|
||||
LL | | }
|
||||
LL | | n
|
||||
LL | | }];
|
||||
|
Loading…
x
Reference in New Issue
Block a user