]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | error[E0512]: cannot transmute between types of different sizes, or dependently-sized types |
2 | --> $DIR/transmute-from-fn-item-types-error.rs:4:13 | |
041b39d2 | 3 | | |
0531ce1d | 4 | LL | let i = mem::transmute(bar); |
041b39d2 XL |
5 | | ^^^^^^^^^^^^^^ |
6 | | | |
0731742a XL |
7 | = note: source type: `unsafe fn() {bar}` (0 bits) |
8 | = note: target type: `i8` (8 bits) | |
041b39d2 XL |
9 | |
10 | error[E0591]: can't transmute zero-sized type | |
0731742a | 11 | --> $DIR/transmute-from-fn-item-types-error.rs:8:13 |
041b39d2 | 12 | | |
0531ce1d | 13 | LL | let p = mem::transmute(foo); |
041b39d2 XL |
14 | | ^^^^^^^^^^^^^^ |
15 | | | |
1b1a35ee | 16 | = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo} |
041b39d2 XL |
17 | = note: target type: *const () |
18 | = help: cast with `as` to a pointer instead | |
19 | ||
20 | error[E0591]: can't transmute zero-sized type | |
0731742a | 21 | --> $DIR/transmute-from-fn-item-types-error.rs:12:14 |
041b39d2 | 22 | | |
0531ce1d | 23 | LL | let of = mem::transmute(main); |
041b39d2 XL |
24 | | ^^^^^^^^^^^^^^ |
25 | | | |
26 | = note: source type: fn() {main} | |
1b1a35ee | 27 | = note: target type: Option<fn()> |
041b39d2 XL |
28 | = help: cast with `as` to a pointer instead |
29 | ||
0731742a XL |
30 | error[E0512]: cannot transmute between types of different sizes, or dependently-sized types |
31 | --> $DIR/transmute-from-fn-item-types-error.rs:21:5 | |
041b39d2 | 32 | | |
0531ce1d | 33 | LL | mem::transmute::<_, u8>(main); |
041b39d2 XL |
34 | | ^^^^^^^^^^^^^^^^^^^^^^^ |
35 | | | |
0731742a XL |
36 | = note: source type: `fn() {main}` (0 bits) |
37 | = note: target type: `u8` (8 bits) | |
041b39d2 XL |
38 | |
39 | error[E0591]: can't transmute zero-sized type | |
0731742a | 40 | --> $DIR/transmute-from-fn-item-types-error.rs:25:5 |
041b39d2 | 41 | | |
0531ce1d | 42 | LL | mem::transmute::<_, *mut ()>(foo); |
041b39d2 XL |
43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
44 | | | |
1b1a35ee | 45 | = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo} |
041b39d2 XL |
46 | = note: target type: *mut () |
47 | = help: cast with `as` to a pointer instead | |
48 | ||
49 | error[E0591]: can't transmute zero-sized type | |
0731742a | 50 | --> $DIR/transmute-from-fn-item-types-error.rs:29:5 |
041b39d2 | 51 | | |
0531ce1d | 52 | LL | mem::transmute::<_, fn()>(bar); |
041b39d2 XL |
53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
54 | | | |
55 | = note: source type: unsafe fn() {bar} | |
56 | = note: target type: fn() | |
57 | = help: cast with `as` to a pointer instead | |
58 | ||
59 | error[E0591]: can't transmute zero-sized type | |
0731742a | 60 | --> $DIR/transmute-from-fn-item-types-error.rs:38:5 |
041b39d2 | 61 | | |
0531ce1d | 62 | LL | mem::transmute::<_, *mut ()>(Some(foo)); |
041b39d2 XL |
63 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
64 | | | |
1b1a35ee | 65 | = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo} |
041b39d2 XL |
66 | = note: target type: *mut () |
67 | = help: cast with `as` to a pointer instead | |
68 | ||
69 | error[E0591]: can't transmute zero-sized type | |
0731742a | 70 | --> $DIR/transmute-from-fn-item-types-error.rs:42:5 |
041b39d2 | 71 | | |
0531ce1d | 72 | LL | mem::transmute::<_, fn()>(Some(bar)); |
041b39d2 XL |
73 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
74 | | | |
75 | = note: source type: unsafe fn() {bar} | |
76 | = note: target type: fn() | |
77 | = help: cast with `as` to a pointer instead | |
78 | ||
79 | error[E0591]: can't transmute zero-sized type | |
0731742a | 80 | --> $DIR/transmute-from-fn-item-types-error.rs:46:5 |
041b39d2 | 81 | | |
0531ce1d | 82 | LL | mem::transmute::<_, Option<fn()>>(Some(baz)); |
041b39d2 XL |
83 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
84 | | | |
85 | = note: source type: unsafe fn() {baz} | |
1b1a35ee | 86 | = note: target type: Option<fn()> |
041b39d2 XL |
87 | = help: cast with `as` to a pointer instead |
88 | ||
89 | error: aborting due to 9 previous errors | |
90 | ||
48663c56 | 91 | Some errors have detailed explanations: E0512, E0591. |
0531ce1d | 92 | For more information about an error, try `rustc --explain E0512`. |