1
+ warning[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
|
@@ -7,8 +16,17 @@ LL | let i = mem::transmute(bar);
7
16
= note: source type: unsafe fn() {bar} (0 bits)
8
17
= note: target type: i8 (8 bits)
9
18
19
+ warning[E0912]: transmutation from a type with an unspecified layout
20
+ --> $DIR/transmute-from-fn-item-types-error.rs:19:13
21
+ |
22
+ LL | let p = mem::transmute(foo);
23
+ | ^^^^^^^^^^^^^^
24
+ |
25
+ = note: unsafe fn() -> (i8, *const (), std::option::Option<fn()>) {foo} has an unspecified layout
26
+ = note: this will become a hard error in the future
27
+
10
28
error[E0591]: can't transmute zero-sized type
11
- --> $DIR/transmute-from-fn-item-types-error.rs:18 :13
29
+ --> $DIR/transmute-from-fn-item-types-error.rs:19 :13
12
30
|
13
31
LL | let p = mem::transmute(foo);
14
32
| ^^^^^^^^^^^^^^
@@ -17,8 +35,17 @@ LL | let p = mem::transmute(foo);
17
35
= note: target type: *const ()
18
36
= help: cast with `as` to a pointer instead
19
37
38
+ warning[E0912]: transmutation from a type with an unspecified layout
39
+ --> $DIR/transmute-from-fn-item-types-error.rs:24:14
40
+ |
41
+ LL | let of = mem::transmute(main);
42
+ | ^^^^^^^^^^^^^^
43
+ |
44
+ = note: fn() {main} has an unspecified layout
45
+ = note: this will become a hard error in the future
46
+
20
47
error[E0591]: can't transmute zero-sized type
21
- --> $DIR/transmute-from-fn-item-types-error.rs:22 :14
48
+ --> $DIR/transmute-from-fn-item-types-error.rs:24 :14
22
49
|
23
50
LL | let of = mem::transmute(main);
24
51
| ^^^^^^^^^^^^^^
@@ -27,17 +54,35 @@ LL | let of = mem::transmute(main);
27
54
= note: target type: std::option::Option<fn()>
28
55
= help: cast with `as` to a pointer instead
29
56
57
+ warning[E0912]: transmutation from a type with an unspecified layout
58
+ --> $DIR/transmute-from-fn-item-types-error.rs:34:5
59
+ |
60
+ LL | mem::transmute::<_, u8>(main);
61
+ | ^^^^^^^^^^^^^^^^^^^^^^^
62
+ |
63
+ = note: fn() {main} has an unspecified layout
64
+ = note: this will become a hard error in the future
65
+
30
66
error[E0512]: transmute called with types of different sizes
31
- --> $DIR/transmute-from-fn-item-types-error.rs:31 :5
67
+ --> $DIR/transmute-from-fn-item-types-error.rs:34 :5
32
68
|
33
69
LL | mem::transmute::<_, u8>(main);
34
70
| ^^^^^^^^^^^^^^^^^^^^^^^
35
71
|
36
72
= note: source type: fn() {main} (0 bits)
37
73
= note: target type: u8 (8 bits)
38
74
75
+ warning[E0912]: transmutation from a type with an unspecified layout
76
+ --> $DIR/transmute-from-fn-item-types-error.rs:39:5
77
+ |
78
+ LL | mem::transmute::<_, *mut ()>(foo);
79
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
+ |
81
+ = note: unsafe fn() -> (i8, *const (), std::option::Option<fn()>) {foo} has an unspecified layout
82
+ = note: this will become a hard error in the future
83
+
39
84
error[E0591]: can't transmute zero-sized type
40
- --> $DIR/transmute-from-fn-item-types-error.rs:35 :5
85
+ --> $DIR/transmute-from-fn-item-types-error.rs:39 :5
41
86
|
42
87
LL | mem::transmute::<_, *mut ()>(foo);
43
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -46,8 +91,17 @@ LL | mem::transmute::<_, *mut ()>(foo);
46
91
= note: target type: *mut ()
47
92
= help: cast with `as` to a pointer instead
48
93
94
+ warning[E0912]: transmutation from a type with an unspecified layout
95
+ --> $DIR/transmute-from-fn-item-types-error.rs:44:5
96
+ |
97
+ LL | mem::transmute::<_, fn()>(bar);
98
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
99
+ |
100
+ = note: unsafe fn() {bar} has an unspecified layout
101
+ = note: this will become a hard error in the future
102
+
49
103
error[E0591]: can't transmute zero-sized type
50
- --> $DIR/transmute-from-fn-item-types-error.rs:39 :5
104
+ --> $DIR/transmute-from-fn-item-types-error.rs:44 :5
51
105
|
52
106
LL | mem::transmute::<_, fn()>(bar);
53
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -56,8 +110,17 @@ LL | mem::transmute::<_, fn()>(bar);
56
110
= note: target type: fn()
57
111
= help: cast with `as` to a pointer instead
58
112
113
+ warning[E0912]: transmutation from a type with an unspecified layout
114
+ --> $DIR/transmute-from-fn-item-types-error.rs:54:5
115
+ |
116
+ LL | mem::transmute::<_, *mut ()>(Some(foo));
117
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118
+ |
119
+ = note: std::option::Option<unsafe fn() -> (i8, *const (), std::option::Option<fn()>) {foo}> has an unspecified layout
120
+ = note: this will become a hard error in the future
121
+
59
122
error[E0591]: can't transmute zero-sized type
60
- --> $DIR/transmute-from-fn-item-types-error.rs:48 :5
123
+ --> $DIR/transmute-from-fn-item-types-error.rs:54 :5
61
124
|
62
125
LL | mem::transmute::<_, *mut ()>(Some(foo));
63
126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,8 +129,17 @@ LL | mem::transmute::<_, *mut ()>(Some(foo));
66
129
= note: target type: *mut ()
67
130
= help: cast with `as` to a pointer instead
68
131
132
+ warning[E0912]: transmutation from a type with an unspecified layout
133
+ --> $DIR/transmute-from-fn-item-types-error.rs:59:5
134
+ |
135
+ LL | mem::transmute::<_, fn()>(Some(bar));
136
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
137
+ |
138
+ = note: std::option::Option<unsafe fn() {bar}> has an unspecified layout
139
+ = note: this will become a hard error in the future
140
+
69
141
error[E0591]: can't transmute zero-sized type
70
- --> $DIR/transmute-from-fn-item-types-error.rs:52 :5
142
+ --> $DIR/transmute-from-fn-item-types-error.rs:59 :5
71
143
|
72
144
LL | mem::transmute::<_, fn()>(Some(bar));
73
145
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -76,8 +148,17 @@ LL | mem::transmute::<_, fn()>(Some(bar));
76
148
= note: target type: fn()
77
149
= help: cast with `as` to a pointer instead
78
150
151
+ warning[E0912]: transmutation from a type with an unspecified layout
152
+ --> $DIR/transmute-from-fn-item-types-error.rs:64:5
153
+ |
154
+ LL | mem::transmute::<_, Option<fn()>>(Some(baz));
155
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
+ |
157
+ = note: std::option::Option<unsafe fn() {baz}> has an unspecified layout
158
+ = note: this will become a hard error in the future
159
+
79
160
error[E0591]: can't transmute zero-sized type
80
- --> $DIR/transmute-from-fn-item-types-error.rs:56 :5
161
+ --> $DIR/transmute-from-fn-item-types-error.rs:64 :5
81
162
|
82
163
LL | mem::transmute::<_, Option<fn()>>(Some(baz));
83
164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -88,5 +169,5 @@ LL | mem::transmute::<_, Option<fn()>>(Some(baz));
88
169
89
170
error: aborting due to 9 previous errors
90
171
91
- Some errors occurred: E0512, E0591.
172
+ Some errors occurred: E0512, E0591, E0912 .
92
173
For more information about an error, try `rustc --explain E0512`.
0 commit comments