From a4ce2011cb0191e3be3dde2bca27b5c1ea4aadf2 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Wed, 13 Nov 2019 14:48:59 -0800 Subject: [PATCH] A `Downcast` is now reached when const-checking a `for` loop I believe this occurs because the old checker stopped processing basic blocks after a `SwitchInt`. --- src/test/compile-fail/consts/const-fn-error.rs | 1 + src/test/compile-fail/issue-52443.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/test/compile-fail/consts/const-fn-error.rs b/src/test/compile-fail/consts/const-fn-error.rs index 4adad16a5701..1a4fc72e8178 100644 --- a/src/test/compile-fail/consts/const-fn-error.rs +++ b/src/test/compile-fail/consts/const-fn-error.rs @@ -9,6 +9,7 @@ const fn f(x: usize) -> usize { //~| ERROR E0017 //~| ERROR E0080 //~| ERROR E0744 + //~| ERROR E0019 sum += i; } sum diff --git a/src/test/compile-fail/issue-52443.rs b/src/test/compile-fail/issue-52443.rs index 04eecb5687fd..ee37aaa5e13b 100644 --- a/src/test/compile-fail/issue-52443.rs +++ b/src/test/compile-fail/issue-52443.rs @@ -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 }