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