Skip to content

Commit a4ce201

Browse files
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`.
1 parent 9a2e53a commit a4ce201

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const fn f(x: usize) -> usize {
99
//~| ERROR E0017
1010
//~| ERROR E0080
1111
//~| ERROR E0744
12+
//~| ERROR E0019
1213
sum += i;
1314
}
1415
sum

src/test/compile-fail/issue-52443.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ fn main() {
1111
//~| ERROR `for` is not allowed in a `const`
1212
//~| ERROR references in constants may only refer to immutable values
1313
//~| ERROR evaluation of constant value failed
14+
//~| ERROR constant contains unimplemented expression type
1415
}

0 commit comments

Comments
 (0)