]>
Commit | Line | Data |
---|---|---|
74b04a01 | 1 | // check-pass |
ba9703b0 | 2 | |
74b04a01 | 3 | #![feature(const_eval_limit)] |
ba9703b0 | 4 | #![feature(const_loop, const_if_match)] |
74b04a01 | 5 | |
ba9703b0 XL |
6 | // This needs to be higher than the number of loop iterations since each pass through the loop may |
7 | // hit more than one terminator. | |
8 | #![const_eval_limit="4000"] | |
74b04a01 | 9 | |
ba9703b0 XL |
10 | const X: usize = { |
11 | let mut x = 0; | |
12 | while x != 1000 { | |
13 | x += 1; | |
14 | } | |
74b04a01 | 15 | |
ba9703b0 XL |
16 | x |
17 | }; | |
74b04a01 | 18 | |
ba9703b0 XL |
19 | fn main() { |
20 | assert_eq!(X, 1000); | |
74b04a01 | 21 | } |