1+ error[E0912]: transmutation from a type with an unspecified layout
2+   --> $DIR/transmute-from-fn-item-types-error.rs:14:13
3+    |
4+ LL |     let i = mem::transmute(bar);
5+    |             ^^^^^^^^^^^^^^
6+    |
7+    = note: unsafe fn() {bar} has an unspecified layout
8+    = note: this will become a hard error in the future
9+ 
110error[E0512]: transmute called with types of different sizes
211  --> $DIR/transmute-from-fn-item-types-error.rs:14:13
312   |
@@ -8,7 +17,7 @@ LL |     let i = mem::transmute(bar);
817   = note: target type: i8 (8 bits)
918
1019error[E0591]: can't transmute zero-sized type
11-   --> $DIR/transmute-from-fn-item-types-error.rs:18 :13
20+   --> $DIR/transmute-from-fn-item-types-error.rs:19 :13
1221   |
1322LL |     let p = mem::transmute(foo);
1423   |             ^^^^^^^^^^^^^^
@@ -18,7 +27,7 @@ LL |     let p = mem::transmute(foo);
1827   = help: cast with `as` to a pointer instead
1928
2029error[E0591]: can't transmute zero-sized type
21-   --> $DIR/transmute-from-fn-item-types-error.rs:22 :14
30+   --> $DIR/transmute-from-fn-item-types-error.rs:23 :14
2231   |
2332LL |     let of = mem::transmute(main);
2433   |              ^^^^^^^^^^^^^^
@@ -27,8 +36,17 @@ LL |     let of = mem::transmute(main);
2736   = note: target type: std::option::Option<fn()>
2837   = help: cast with `as` to a pointer instead
2938
39+ error[E0912]: transmutation from a type with an unspecified layout
40+   --> $DIR/transmute-from-fn-item-types-error.rs:32:5
41+    |
42+ LL |     mem::transmute::<_, u8>(main);
43+    |     ^^^^^^^^^^^^^^^^^^^^^^^
44+    |
45+    = note: fn() {main} has an unspecified layout
46+    = note: this will become a hard error in the future
47+ 
3048error[E0512]: transmute called with types of different sizes
31-   --> $DIR/transmute-from-fn-item-types-error.rs:31 :5
49+   --> $DIR/transmute-from-fn-item-types-error.rs:32 :5
3250   |
3351LL |     mem::transmute::<_, u8>(main);
3452   |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +55,7 @@ LL |     mem::transmute::<_, u8>(main);
3755   = note: target type: u8 (8 bits)
3856
3957error[E0591]: can't transmute zero-sized type
40-   --> $DIR/transmute-from-fn-item-types-error.rs:35 :5
58+   --> $DIR/transmute-from-fn-item-types-error.rs:37 :5
4159   |
4260LL |     mem::transmute::<_, *mut ()>(foo);
4361   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +65,7 @@ LL |     mem::transmute::<_, *mut ()>(foo);
4765   = help: cast with `as` to a pointer instead
4866
4967error[E0591]: can't transmute zero-sized type
50-   --> $DIR/transmute-from-fn-item-types-error.rs:39 :5
68+   --> $DIR/transmute-from-fn-item-types-error.rs:41 :5
5169   |
5270LL |     mem::transmute::<_, fn()>(bar);
5371   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -57,7 +75,7 @@ LL |     mem::transmute::<_, fn()>(bar);
5775   = help: cast with `as` to a pointer instead
5876
5977error[E0591]: can't transmute zero-sized type
60-   --> $DIR/transmute-from-fn-item-types-error.rs:48 :5
78+   --> $DIR/transmute-from-fn-item-types-error.rs:50 :5
6179   |
6280LL |     mem::transmute::<_, *mut ()>(Some(foo));
6381   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -67,7 +85,7 @@ LL |     mem::transmute::<_, *mut ()>(Some(foo));
6785   = help: cast with `as` to a pointer instead
6886
6987error[E0591]: can't transmute zero-sized type
70-   --> $DIR/transmute-from-fn-item-types-error.rs:52 :5
88+   --> $DIR/transmute-from-fn-item-types-error.rs:54 :5
7189   |
7290LL |     mem::transmute::<_, fn()>(Some(bar));
7391   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,7 +95,7 @@ LL |     mem::transmute::<_, fn()>(Some(bar));
7795   = help: cast with `as` to a pointer instead
7896
7997error[E0591]: can't transmute zero-sized type
80-   --> $DIR/transmute-from-fn-item-types-error.rs:56 :5
98+   --> $DIR/transmute-from-fn-item-types-error.rs:58 :5
8199   |
82100LL |     mem::transmute::<_, Option<fn()>>(Some(baz));
83101   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -86,7 +104,7 @@ LL |     mem::transmute::<_, Option<fn()>>(Some(baz));
86104   = note: target type: std::option::Option<fn()>
87105   = help: cast with `as` to a pointer instead
88106
89- error: aborting due to 9  previous errors
107+ error: aborting due to 11  previous errors
90108
91- Some errors occurred: E0512, E0591.
109+ Some errors occurred: E0512, E0591, E0912 .
92110For more information about an error, try `rustc --explain E0512`.
0 commit comments