fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.3 KiB34 linesraw
1error[E0658]: `while` is not allowed in a `const`
2  --> $DIR/infinite_loop.rs:6:9
3   |
4LL | /         while n != 0 {
5LL | |
6LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
7LL | |
8LL | |
9LL | |         }
10   | |_________^
11   |
12   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
13   = help: add `#![feature(const_loop)]` to the crate attributes to enable
14   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
15
16error[E0658]: `if` is not allowed in a `const`
17  --> $DIR/infinite_loop.rs:8:17
18   |
19LL |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
20   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21   |
22   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
23   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
24
25error[E0080]: evaluation of constant value failed
26  --> $DIR/infinite_loop.rs:8:20
27   |
28LL |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
29   |                    ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
30
31error: aborting due to 3 previous errors
32
33Some errors have detailed explanations: E0080, E0658.
34For more information about an error, try `rustc --explain E0080`.