rust/tests/ui/transmute/transmute-from-fn-item-types-error.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
3 KiB
Plaintext
Raw Normal View History

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
|
2018-02-23 00:42:32 +00:00
LL | let i = mem::transmute(bar);
| ^^^^^^^^^^^^^^
|
2018-12-21 14:15:47 +00:00
= note: source type: `unsafe fn() {bar}` (0 bits)
= note: target type: `i8` (8 bits)
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
|
2018-02-23 00:42:32 +00:00
LL | let p = mem::transmute(foo);
| ^^^^^^^^^^^^^^
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
= 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
|
2018-02-23 00:42:32 +00:00
LL | let of = mem::transmute(main);
| ^^^^^^^^^^^^^^
|
= note: source type: fn() {main}
= note: target type: Option<fn()>
= 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
|
2018-02-23 00:42:32 +00:00
LL | mem::transmute::<_, u8>(main);
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2018-12-21 14:15:47 +00:00
= note: source type: `fn() {main}` (0 bits)
= note: target type: `u8` (8 bits)
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
|
2018-02-23 00:42:32 +00:00
LL | mem::transmute::<_, *mut ()>(foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
= 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
|
2018-02-23 00:42:32 +00:00
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
2018-12-25 15:56:47 +00:00
--> $DIR/transmute-from-fn-item-types-error.rs:38:5
|
2018-02-23 00:42:32 +00:00
LL | mem::transmute::<_, *mut ()>(Some(foo));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: unsafe fn() -> (i8, *const (), Option<fn()>) {foo}
= 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
|
2018-02-23 00:42:32 +00:00
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
2018-12-25 15:56:47 +00:00
--> $DIR/transmute-from-fn-item-types-error.rs:46:5
|
2018-02-23 00:42:32 +00:00
LL | mem::transmute::<_, Option<fn()>>(Some(baz));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: source type: unsafe fn() {baz}
= note: target type: Option<fn()>
= help: cast with `as` to a pointer instead
error: aborting due to 9 previous errors
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`.