fork/rust

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

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

master
997 B21 linesraw
1error[E0658]: floating point arithmetic is not allowed in constant functions
2  --> $DIR/const-extern-fn-min-const-fn.rs:5:42
3   |
4LL | const unsafe extern "C" fn use_float() { 1.0 + 1.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: pointers cannot be cast to integers during const eval
11  --> $DIR/const-extern-fn-min-const-fn.rs:7:48
12   |
13LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
14   |                                                ^^^^^^^^^^^^
15   |
16   = note: at compile-time, pointers do not have an integer value
17   = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
18
19error: aborting due to 2 previous errors
20
21For more information about this error, try `rustc --explain E0658`.