|
| 1 | +error[E0512]: transmute called with types of different sizes |
| 2 | + --> $DIR/transmute-from-fn-item-types-error.rs:16:13 |
| 3 | + | |
| 4 | +16 | let i = mem::transmute(bar); |
| 5 | + | ^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: source type: unsafe fn() {bar} (0 bits) |
| 8 | + = note: target type: i32 (32 bits) |
| 9 | + |
| 10 | +error[E0591]: can't transmute zero-sized type |
| 11 | + --> $DIR/transmute-from-fn-item-types-error.rs:20:13 |
| 12 | + | |
| 13 | +20 | let p = mem::transmute(foo); |
| 14 | + | ^^^^^^^^^^^^^^ |
| 15 | + | |
| 16 | + = note: source type: unsafe fn() -> (i32, *const (), std::option::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:24:14 |
| 22 | + | |
| 23 | +24 | let of = mem::transmute(main); |
| 24 | + | ^^^^^^^^^^^^^^ |
| 25 | + | |
| 26 | + = note: source type: fn() {main} |
| 27 | + = note: target type: std::option::Option<fn()> |
| 28 | + = help: cast with `as` to a pointer instead |
| 29 | + |
| 30 | +error[E0512]: transmute called with types of different sizes |
| 31 | + --> $DIR/transmute-from-fn-item-types-error.rs:33:5 |
| 32 | + | |
| 33 | +33 | 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:37:5 |
| 41 | + | |
| 42 | +37 | mem::transmute::<_, *mut ()>(foo); |
| 43 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 44 | + | |
| 45 | + = note: source type: unsafe fn() -> (i32, *const (), std::option::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:41:5 |
| 51 | + | |
| 52 | +41 | 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[E0512]: transmute called with types of different sizes |
| 60 | + --> $DIR/transmute-from-fn-item-types-error.rs:46:5 |
| 61 | + | |
| 62 | +46 | mem::transmute::<fn(), u32>(main); |
| 63 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 64 | + | |
| 65 | + = note: source type: fn() (64 bits) |
| 66 | + = note: target type: u32 (32 bits) |
| 67 | + |
| 68 | +error[E0591]: can't transmute zero-sized type |
| 69 | + --> $DIR/transmute-from-fn-item-types-error.rs:50:5 |
| 70 | + | |
| 71 | +50 | mem::transmute::<_, *mut ()>(Some(foo)); |
| 72 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 73 | + | |
| 74 | + = note: source type: unsafe fn() -> (i32, *const (), std::option::Option<fn()>) {foo} |
| 75 | + = note: target type: *mut () |
| 76 | + = help: cast with `as` to a pointer instead |
| 77 | + |
| 78 | +error[E0591]: can't transmute zero-sized type |
| 79 | + --> $DIR/transmute-from-fn-item-types-error.rs:54:5 |
| 80 | + | |
| 81 | +54 | mem::transmute::<_, fn()>(Some(bar)); |
| 82 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 83 | + | |
| 84 | + = note: source type: unsafe fn() {bar} |
| 85 | + = note: target type: fn() |
| 86 | + = help: cast with `as` to a pointer instead |
| 87 | + |
| 88 | +error[E0591]: can't transmute zero-sized type |
| 89 | + --> $DIR/transmute-from-fn-item-types-error.rs:58:5 |
| 90 | + | |
| 91 | +58 | mem::transmute::<_, Option<fn()>>(Some(baz)); |
| 92 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 93 | + | |
| 94 | + = note: source type: unsafe fn() {baz} |
| 95 | + = note: target type: std::option::Option<fn()> |
| 96 | + = help: cast with `as` to a pointer instead |
| 97 | + |
| 98 | +error[E0512]: transmute called with types of different sizes |
| 99 | + --> $DIR/transmute-from-fn-item-types-error.rs:63:5 |
| 100 | + | |
| 101 | +63 | mem::transmute::<Option<fn()>, u32>(Some(main)); |
| 102 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 103 | + | |
| 104 | + = note: source type: std::option::Option<fn()> (64 bits) |
| 105 | + = note: target type: u32 (32 bits) |
| 106 | + |
| 107 | +error: aborting due to previous error(s) |
| 108 | + |
0 commit comments