blob: de2624d7f7acf069070a3026631bc4e8f3fd3b5e [file] [log] [blame]
error[E0744]: `while` is not allowed in a `const`
--> $DIR/infinite_loop.rs:7:9
|
LL | / while n != 0 {
LL | |
LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
LL | |
LL | |
LL | | }
| |_________^
error[E0658]: `if` is not allowed in a `const`
--> $DIR/infinite_loop.rs:9:17
|
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
warning: Constant evaluating a complex constant, this might take some time
--> $DIR/infinite_loop.rs:4:18
|
LL | let _ = [(); {
| __________________^
LL | |
LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
LL | | while n != 0 {
... |
LL | | n
LL | | }];
| |_____^
error[E0080]: evaluation of constant value failed
--> $DIR/infinite_loop.rs:9:20
|
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
| ^^^^^^^^^^ duplicate interpreter state observed here, const evaluation will never terminate
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0080, E0658, E0744.
For more information about an error, try `rustc --explain E0080`.