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