| warning: pointers cannot be transmuted to integers during const eval |
| --> $DIR/ptr-to-int-transmute-in-consts-issue-87525.rs:61:9 |
| | |
| LL | std::mem::transmute(ptr) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = note: at compile-time, pointers do not have an integer value |
| = note: avoiding this restriction via `union` or raw pointers leads to compile-time undefined behavior |
| = help: for more information, see https://doc.rust-lang.org/std/mem/fn.transmute.html |
| = note: `#[warn(ptr_to_integer_transmute_in_consts)]` on by default |
| |
| error[E0080]: evaluation of constant value failed |
| --> $DIR/ptr-to-int-transmute-in-consts-issue-87525.rs:68:26 |
| | |
| LL | const value: usize = zoom(&a); |
| | ^^^^^^^^ unable to turn pointer into integer |
| | |
| = help: this code performed an operation that depends on the underlying bytes representing a pointer |
| = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported |
| |
| warning: pointers cannot be transmuted to integers during const eval |
| --> $DIR/ptr-to-int-transmute-in-consts-issue-87525.rs:3:9 |
| | |
| LL | std::mem::transmute(ptr) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = note: at compile-time, pointers do not have an integer value |
| = note: avoiding this restriction via `union` or raw pointers leads to compile-time undefined behavior |
| = help: for more information, see https://doc.rust-lang.org/std/mem/fn.transmute.html |
| |
| warning: pointers cannot be transmuted to integers during const eval |
| --> $DIR/ptr-to-int-transmute-in-consts-issue-87525.rs:13:13 |
| | |
| LL | std::mem::transmute(ptr) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = note: at compile-time, pointers do not have an integer value |
| = note: avoiding this restriction via `union` or raw pointers leads to compile-time undefined behavior |
| = help: for more information, see https://doc.rust-lang.org/std/mem/fn.transmute.html |
| |
| warning: pointers cannot be transmuted to integers during const eval |
| --> $DIR/ptr-to-int-transmute-in-consts-issue-87525.rs:30:13 |
| | |
| LL | std::mem::transmute(ptr) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = note: at compile-time, pointers do not have an integer value |
| = note: avoiding this restriction via `union` or raw pointers leads to compile-time undefined behavior |
| = help: for more information, see https://doc.rust-lang.org/std/mem/fn.transmute.html |
| |
| error: aborting due to 1 previous error; 4 warnings emitted |
| |
| For more information about this error, try `rustc --explain E0080`. |