]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-eval/infinite_loop.stderr
Auto merge of #51702 - ecstatic-morse:infinite-loop-detection, r=oli-obk
[rust.git] / src / test / ui / const-eval / infinite_loop.stderr
1 error[E0019]: constant contains unimplemented expression type
2   --> $DIR/infinite_loop.rs:20:9
3    |
4 LL | /         while n != 0 { //~ ERROR constant contains unimplemented expression type
5 LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
6 LL | |         }
7    | |_________^
8
9 warning: Constant evaluating a complex constant, this might take some time
10   --> $DIR/infinite_loop.rs:16:18
11    |
12 LL |       let _ = [(); {
13    |  __________________^
14 LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
15 LL | |         //~| ERROR could not evaluate repeat length
16 LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
17 ...  |
18 LL | |         n
19 LL | |     }];
20    | |_____^
21
22 error[E0080]: could not evaluate repeat length
23   --> $DIR/infinite_loop.rs:16:18
24    |
25 LL |       let _ = [(); {
26    |  __________________^
27 LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
28 LL | |         //~| ERROR could not evaluate repeat length
29 LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
30 LL | |         while n != 0 { //~ ERROR constant contains unimplemented expression type
31 LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
32    | |                    ---------- duplicate interpreter state observed here, const evaluation will never terminate
33 LL | |         }
34 LL | |         n
35 LL | |     }];
36    | |_____^
37
38 error: aborting due to 2 previous errors
39
40 Some errors occurred: E0019, E0080.
41 For more information about an error, try `rustc --explain E0019`.