]> git.lizzy.rs Git - rust.git/commitdiff
A `Downcast` is now reached when const-checking a `for` loop
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Wed, 13 Nov 2019 22:48:59 +0000 (14:48 -0800)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Fri, 15 Nov 2019 18:33:52 +0000 (10:33 -0800)
I believe this occurs because the old checker stopped processing basic
blocks after a `SwitchInt`.

src/test/compile-fail/consts/const-fn-error.rs
src/test/compile-fail/issue-52443.rs

index 4adad16a5701068c6bb558a5a780ada45b48324d..1a4fc72e8178647074a35c253deb89a1bf47baca 100644 (file)
@@ -9,6 +9,7 @@ const fn f(x: usize) -> usize {
         //~| ERROR E0017
         //~| ERROR E0080
         //~| ERROR E0744
+        //~| ERROR E0019
         sum += i;
     }
     sum
index 04eecb5687fd903608ff9a0694cc5da1b278791c..ee37aaa5e13b943c7b715e3d42f24c47e210454a 100644 (file)
@@ -11,4 +11,5 @@ fn main() {
     //~| ERROR `for` is not allowed in a `const`
     //~| ERROR references in constants may only refer to immutable values
     //~| ERROR evaluation of constant value failed
+    //~| ERROR constant contains unimplemented expression type
 }