summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval/infinite_loop.stderr
blob: ebdb73c44679150fd2299e20740fba318d9f62d8 (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
error[E0658]: `while` is not allowed in a `const`
  --> $DIR/infinite_loop.rs:6:9
   |
LL | /         while n != 0 {
LL | |
LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
LL | |
LL | |
LL | |         }
   | |_________^
   |
   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
   = help: add `#![feature(const_loop)]` to the crate attributes to enable
   = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0658]: `if` is not allowed in a `const`
  --> $DIR/infinite_loop.rs:8:17
   |
LL |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0080]: evaluation of constant value failed
  --> $DIR/infinite_loop.rs:8:20
   |
LL |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
   |                    ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0080, E0658.
For more information about an error, try `rustc --explain E0080`.