rust/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
997 B
Plaintext
Raw Normal View History

2020-09-23 13:58:41 -05:00
error[E0658]: floating point arithmetic is not allowed in constant functions
--> $DIR/const-extern-fn-min-const-fn.rs:5:42
|
LL | const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
| ^^^^^^^^^
|
= 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
2021-10-03 01:53:02 -05:00
error: pointers cannot be cast to integers during const eval
--> $DIR/const-extern-fn-min-const-fn.rs:7:48
|
LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
| ^^^^^^^^^^^^
|
= 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
error: aborting due to 2 previous errors
2020-09-24 18:18:49 -05:00
For more information about this error, try `rustc --explain E0658`.