fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.2 KiB48 linesraw
1error[E0658]: floating point arithmetic is not allowed in constant functions
2  --> $DIR/const_fn_floating_point_arithmetic.rs:8:31
3   |
4LL | const fn add(f: f32) -> f32 { f + 2.0 }
5   |                               ^^^^^^^
6   |
7   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
8   = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
9
10error[E0658]: floating point arithmetic is not allowed in constant functions
11  --> $DIR/const_fn_floating_point_arithmetic.rs:10:31
12   |
13LL | const fn sub(f: f32) -> f32 { 2.0 - f }
14   |                               ^^^^^^^
15   |
16   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
17   = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
18
19error[E0658]: floating point arithmetic is not allowed in constant functions
20  --> $DIR/const_fn_floating_point_arithmetic.rs:12:39
21   |
22LL | const fn mul(f: f32, g: f32) -> f32 { f * g }
23   |                                       ^^^^^
24   |
25   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
26   = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
27
28error[E0658]: floating point arithmetic is not allowed in constant functions
29  --> $DIR/const_fn_floating_point_arithmetic.rs:14:39
30   |
31LL | const fn div(f: f32, g: f32) -> f32 { f / g }
32   |                                       ^^^^^
33   |
34   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
35   = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
36
37error[E0658]: floating point arithmetic is not allowed in constant functions
38  --> $DIR/const_fn_floating_point_arithmetic.rs:16:31
39   |
40LL | const fn neg(f: f32) -> f32 { -f }
41   |                               ^^
42   |
43   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
44   = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
45
46error: aborting due to 5 previous errors
47
48For more information about this error, try `rustc --explain E0658`.