File: ptr-to-int-transmute-in-consts-issue-87525.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (53 lines) | stat: -rw-r--r-- 2,588 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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`.