error[E0512]: transmute called with types of different sizes --> $DIR/transmute-from-fn-item-types-error.rs:14:13 | LL | let i = mem::transmute(bar); | ^^^^^^^^^^^^^^ | = note: source type: unsafe fn() {bar} (0 bits) = note: target type: i8 (8 bits) error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:18:13 | LL | let p = mem::transmute(foo); | ^^^^^^^^^^^^^^ | = note: source type: unsafe fn() -> (i8, *const (), std::option::Option) {foo} = note: target type: *const () = help: cast with `as` to a pointer instead error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:22:14 | LL | let of = mem::transmute(main); | ^^^^^^^^^^^^^^ | = note: source type: fn() {main} = note: target type: std::option::Option = help: cast with `as` to a pointer instead error[E0512]: transmute called with types of different sizes --> $DIR/transmute-from-fn-item-types-error.rs:31:5 | LL | mem::transmute::<_, u8>(main); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: fn() {main} (0 bits) = note: target type: u8 (8 bits) error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:35:5 | LL | mem::transmute::<_, *mut ()>(foo); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: unsafe fn() -> (i8, *const (), std::option::Option) {foo} = note: target type: *mut () = help: cast with `as` to a pointer instead error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:39:5 | LL | mem::transmute::<_, fn()>(bar); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: unsafe fn() {bar} = note: target type: fn() = help: cast with `as` to a pointer instead error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:48:5 | LL | mem::transmute::<_, *mut ()>(Some(foo)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: unsafe fn() -> (i8, *const (), std::option::Option) {foo} = note: target type: *mut () = help: cast with `as` to a pointer instead error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:52:5 | LL | mem::transmute::<_, fn()>(Some(bar)); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: unsafe fn() {bar} = note: target type: fn() = help: cast with `as` to a pointer instead error[E0591]: can't transmute zero-sized type --> $DIR/transmute-from-fn-item-types-error.rs:56:5 | LL | mem::transmute::<_, Option>(Some(baz)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: unsafe fn() {baz} = note: target type: std::option::Option = help: cast with `as` to a pointer instead error: aborting due to 9 previous errors Some errors occurred: E0512, E0591. For more information about an error, try `rustc --explain E0512`.