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
4 LL | let i = mem::transmute(bar);
7 = note: source type: `unsafe fn() {bar}` (0 bits)
8 = note: target type: `i8` (8 bits)
10 error[E0591]: can't transmute zero-sized type
11 --> $DIR/transmute-from-fn-item-types-error.rs:8:13
13 LL | let p = mem::transmute(foo);
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
20 error[E0591]: can't transmute zero-sized type
21 --> $DIR/transmute-from-fn-item-types-error.rs:12:14
23 LL | let of = mem::transmute(main);
26 = note: source type: fn() {main}
27 = note: target type: Option<fn()>
28 = help: cast with `as` to a pointer instead
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
33 LL | mem::transmute::<_, u8>(main);
34 | ^^^^^^^^^^^^^^^^^^^^^^^
36 = note: source type: `fn() {main}` (0 bits)
37 = note: target type: `u8` (8 bits)
39 error[E0591]: can't transmute zero-sized type
40 --> $DIR/transmute-from-fn-item-types-error.rs:25:5
42 LL | mem::transmute::<_, *mut ()>(foo);
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
49 error[E0591]: can't transmute zero-sized type
50 --> $DIR/transmute-from-fn-item-types-error.rs:29:5
52 LL | mem::transmute::<_, fn()>(bar);
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^
55 = note: source type: unsafe fn() {bar}
56 = note: target type: fn()
57 = help: cast with `as` to a pointer instead
59 error[E0591]: can't transmute zero-sized type
60 --> $DIR/transmute-from-fn-item-types-error.rs:38:5
62 LL | mem::transmute::<_, *mut ()>(Some(foo));
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
69 error[E0591]: can't transmute zero-sized type
70 --> $DIR/transmute-from-fn-item-types-error.rs:42:5
72 LL | mem::transmute::<_, fn()>(Some(bar));
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^
75 = note: source type: unsafe fn() {bar}
76 = note: target type: fn()
77 = help: cast with `as` to a pointer instead
79 error[E0591]: can't transmute zero-sized type
80 --> $DIR/transmute-from-fn-item-types-error.rs:46:5
82 LL | mem::transmute::<_, Option<fn()>>(Some(baz));
83 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85 = note: source type: unsafe fn() {baz}
86 = note: target type: Option<fn()>
87 = help: cast with `as` to a pointer instead
89 error: aborting due to 9 previous errors
91 Some errors have detailed explanations: E0512, E0591.
92 For more information about an error, try `rustc --explain E0512`.