]> git.proxmox.com Git - rustc.git/blob - src/test/ui/transmute/transmute-from-fn-item-types-error.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / transmute / transmute-from-fn-item-types-error.stderr
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
3 |
4 LL | let i = mem::transmute(bar);
5 | ^^^^^^^^^^^^^^
6 |
7 = note: source type: `unsafe fn() {bar}` (0 bits)
8 = note: target type: `i8` (8 bits)
9
10 error[E0591]: can't transmute zero-sized type
11 --> $DIR/transmute-from-fn-item-types-error.rs:8:13
12 |
13 LL | let p = mem::transmute(foo);
14 | ^^^^^^^^^^^^^^
15 |
16 = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
17 = note: target type: *const ()
18 = help: cast with `as` to a pointer instead
19
20 error[E0591]: can't transmute zero-sized type
21 --> $DIR/transmute-from-fn-item-types-error.rs:12:14
22 |
23 LL | let of = mem::transmute(main);
24 | ^^^^^^^^^^^^^^
25 |
26 = note: source type: fn() {main}
27 = note: target type: Option<fn()>
28 = help: cast with `as` to a pointer instead
29
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
32 |
33 LL | mem::transmute::<_, u8>(main);
34 | ^^^^^^^^^^^^^^^^^^^^^^^
35 |
36 = note: source type: `fn() {main}` (0 bits)
37 = note: target type: `u8` (8 bits)
38
39 error[E0591]: can't transmute zero-sized type
40 --> $DIR/transmute-from-fn-item-types-error.rs:25:5
41 |
42 LL | mem::transmute::<_, *mut ()>(foo);
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 |
45 = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
46 = note: target type: *mut ()
47 = help: cast with `as` to a pointer instead
48
49 error[E0591]: can't transmute zero-sized type
50 --> $DIR/transmute-from-fn-item-types-error.rs:29:5
51 |
52 LL | mem::transmute::<_, fn()>(bar);
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
60 --> $DIR/transmute-from-fn-item-types-error.rs:38:5
61 |
62 LL | mem::transmute::<_, *mut ()>(Some(foo));
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 |
65 = note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
66 = note: target type: *mut ()
67 = help: cast with `as` to a pointer instead
68
69 error[E0591]: can't transmute zero-sized type
70 --> $DIR/transmute-from-fn-item-types-error.rs:42:5
71 |
72 LL | mem::transmute::<_, fn()>(Some(bar));
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
80 --> $DIR/transmute-from-fn-item-types-error.rs:46:5
81 |
82 LL | mem::transmute::<_, Option<fn()>>(Some(baz));
83 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84 |
85 = note: source type: unsafe fn() {baz}
86 = note: target type: Option<fn()>
87 = help: cast with `as` to a pointer instead
88
89 error: aborting due to 9 previous errors
90
91 Some errors have detailed explanations: E0512, E0591.
92 For more information about an error, try `rustc --explain E0512`.