2018-12-21 14:15:47 +00:00
|
|
|
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:4:13
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let i = mem::transmute(bar);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2018-12-21 14:15:47 +00:00
|
|
|
= note: source type: `unsafe fn() {bar}` (0 bits)
|
|
|
|
= note: target type: `i8` (8 bits)
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
|
|
error[E0591]: can't transmute zero-sized type
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:8:13
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let p = mem::transmute(foo);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
|
2017-05-29 23:22:41 +00:00
|
|
|
= note: target type: *const ()
|
|
|
|
= help: cast with `as` to a pointer instead
|
|
|
|
|
|
|
|
error[E0591]: can't transmute zero-sized type
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:12:14
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let of = mem::transmute(main);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: source type: fn() {main}
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: target type: Option<fn()>
|
2017-05-29 23:22:41 +00:00
|
|
|
= help: cast with `as` to a pointer instead
|
|
|
|
|
2018-12-21 14:15:47 +00:00
|
|
|
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:21:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, u8>(main);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2018-12-21 14:15:47 +00:00
|
|
|
= note: source type: `fn() {main}` (0 bits)
|
|
|
|
= note: target type: `u8` (8 bits)
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
|
|
error[E0591]: can't transmute zero-sized type
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:25:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, *mut ()>(foo);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
|
2017-05-29 23:22:41 +00:00
|
|
|
= note: target type: *mut ()
|
|
|
|
= help: cast with `as` to a pointer instead
|
|
|
|
|
|
|
|
error[E0591]: can't transmute zero-sized type
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:29:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, fn()>(bar);
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= 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
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:38:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, *mut ()>(Some(foo));
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
|
2017-05-29 23:22:41 +00:00
|
|
|
= note: target type: *mut ()
|
|
|
|
= help: cast with `as` to a pointer instead
|
|
|
|
|
|
|
|
error[E0591]: can't transmute zero-sized type
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:42:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, fn()>(Some(bar));
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= 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
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/transmute-from-fn-item-types-error.rs:46:5
|
2017-05-29 23:22:41 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::transmute::<_, Option<fn()>>(Some(baz));
|
2017-05-29 23:22:41 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: source type: unsafe fn() {baz}
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: target type: Option<fn()>
|
2017-05-29 23:22:41 +00:00
|
|
|
= help: cast with `as` to a pointer instead
|
|
|
|
|
2017-07-06 05:54:58 +00:00
|
|
|
error: aborting due to 9 previous errors
|
2017-05-29 23:22:41 +00:00
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0512, E0591.
|
2018-03-03 14:59:40 +00:00
|
|
|
For more information about an error, try `rustc --explain E0512`.
|