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
+
1
10
error[E0512]: transmute called with types of different sizes
2
11
--> $DIR/transmute-from-fn-item-types-error.rs:14:13
3
12
|
@@ -8,7 +17,7 @@ LL | let i = mem::transmute(bar);
8
17
= note: target type: i8 (8 bits)
9
18
10
19
error[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
12
21
|
13
22
LL | let p = mem::transmute(foo);
14
23
| ^^^^^^^^^^^^^^
@@ -18,7 +27,7 @@ LL | let p = mem::transmute(foo);
18
27
= help: cast with `as` to a pointer instead
19
28
20
29
error[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
22
31
|
23
32
LL | let of = mem::transmute(main);
24
33
| ^^^^^^^^^^^^^^
@@ -27,8 +36,17 @@ LL | let of = mem::transmute(main);
27
36
= note: target type: std::option::Option<fn()>
28
37
= help: cast with `as` to a pointer instead
29
38
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
+
30
48
error[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
32
50
|
33
51
LL | mem::transmute::<_, u8>(main);
34
52
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +55,7 @@ LL | mem::transmute::<_, u8>(main);
37
55
= note: target type: u8 (8 bits)
38
56
39
57
error[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
41
59
|
42
60
LL | mem::transmute::<_, *mut ()>(foo);
43
61
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +65,7 @@ LL | mem::transmute::<_, *mut ()>(foo);
47
65
= help: cast with `as` to a pointer instead
48
66
49
67
error[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
51
69
|
52
70
LL | mem::transmute::<_, fn()>(bar);
53
71
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -57,7 +75,7 @@ LL | mem::transmute::<_, fn()>(bar);
57
75
= help: cast with `as` to a pointer instead
58
76
59
77
error[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
61
79
|
62
80
LL | mem::transmute::<_, *mut ()>(Some(foo));
63
81
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -67,7 +85,7 @@ LL | mem::transmute::<_, *mut ()>(Some(foo));
67
85
= help: cast with `as` to a pointer instead
68
86
69
87
error[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
71
89
|
72
90
LL | mem::transmute::<_, fn()>(Some(bar));
73
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,7 +95,7 @@ LL | mem::transmute::<_, fn()>(Some(bar));
77
95
= help: cast with `as` to a pointer instead
78
96
79
97
error[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
81
99
|
82
100
LL | mem::transmute::<_, Option<fn()>>(Some(baz));
83
101
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -86,7 +104,7 @@ LL | mem::transmute::<_, Option<fn()>>(Some(baz));
86
104
= note: target type: std::option::Option<fn()>
87
105
= help: cast with `as` to a pointer instead
88
106
89
- error: aborting due to 9 previous errors
107
+ error: aborting due to 11 previous errors
90
108
91
- Some errors occurred: E0512, E0591.
109
+ Some errors occurred: E0512, E0591, E0912 .
92
110
For more information about an error, try `rustc --explain E0512`.
0 commit comments