2020-09-23 13:58:41 -05:00
|
|
|
error[E0658]: floating point arithmetic is not allowed in constant functions
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/const-extern-fn-min-const-fn.rs:5:42
|
2019-09-29 18:22:18 -05:00
|
|
|
|
|
2020-09-01 16:28:11 -05:00
|
|
|
LL | const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
|
|
|
|
| ^^^^^^^^^
|
2019-09-29 18:22:18 -05:00
|
|
|
|
|
2020-09-23 15:08:20 -05:00
|
|
|
= note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
|
2020-09-23 13:58:41 -05:00
|
|
|
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
|
2019-09-29 18:22:18 -05:00
|
|
|
|
2021-10-03 01:53:02 -05:00
|
|
|
error: pointers cannot be cast to integers during const eval
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/const-extern-fn-min-const-fn.rs:7:48
|
2019-09-29 18:22:18 -05:00
|
|
|
|
|
|
|
|
LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2021-07-10 04:33:42 -05:00
|
|
|
= note: at compile-time, pointers do not have an integer value
|
|
|
|
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
2019-09-29 18:22:18 -05:00
|
|
|
|
2022-02-09 12:53:40 -06:00
|
|
|
error: aborting due to 2 previous errors
|
2019-09-29 18:22:18 -05:00
|
|
|
|
2020-09-24 18:18:49 -05:00
|
|
|
For more information about this error, try `rustc --explain E0658`.
|