summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval/infinite_loop.stderr
blob: f69aae29203600102a6e20e96a7b9c394ebd6766 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
error[E0019]: constant contains unimplemented expression type
  --> $DIR/infinite_loop.rs:20:9
   |
LL | /         while n != 0 { //~ ERROR constant contains unimplemented expression type
LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
LL | |         }
   | |_________^

warning: Constant evaluating a complex constant, this might take some time
  --> $DIR/infinite_loop.rs:16:18
   |
LL |       let _ = [(); {
   |  __________________^
LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
LL | |         //~| ERROR could not evaluate repeat length
LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
...  |
LL | |         n
LL | |     }];
   | |_____^

error[E0080]: could not evaluate repeat length
  --> $DIR/infinite_loop.rs:16:18
   |
LL |       let _ = [(); {
   |  __________________^
LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
LL | |         //~| ERROR could not evaluate repeat length
LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
LL | |         while n != 0 { //~ ERROR constant contains unimplemented expression type
LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
   | |                    ---------- duplicate interpreter state observed here, const evaluation will never terminate
LL | |         }
LL | |         n
LL | |     }];
   | |_____^

error: aborting due to 2 previous errors

Some errors occurred: E0019, E0080.
For more information about an error, try `rustc --explain E0019`.