]> git.lizzy.rs Git - rust.git/commitdiff
Shorten error message and add link to test
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Fri, 29 Jun 2018 20:32:54 +0000 (13:32 -0700)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Wed, 4 Jul 2018 21:36:07 +0000 (14:36 -0700)
Implements @bjorn3's suggestions.

src/librustc/mir/interpret/error.rs
src/test/ui/const-eval/infinite_loop.rs
src/test/ui/const-eval/infinite_loop.stderr

index 68e1d6c65c06c8e5d5f652c316153572c0bb6fa0..9125597a7273eeae9558950f429b010099a0bbbb 100644 (file)
@@ -400,8 +400,7 @@ pub fn description(&self) -> &str {
             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",
         }
     }
 }
index 8011cf83eedbfb12a8af2f4a93794f7e6ab82373..a1f8ab7f878824f78e0cf1948a0412f7807c6b0e 100644 (file)
@@ -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 };
         }
index 95c15c3e4e254ae54045b5f37012b00dff6b4e1e..f69aae29203600102a6e20e96a7b9c394ebd6766 100644 (file)
@@ -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 | |     }];