@@ -3,16 +3,30 @@ error: `...` is not supported for non-extern functions
3
3
|
4
4
LL | fn f1_1(x: isize, ...) {}
5
5
| ^^^
6
+ |
7
+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
6
8
7
9
error: `...` is not supported for non-extern functions
8
10
--> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
9
11
|
10
12
LL | fn f1_2(...) {}
11
13
| ^^^
14
+ |
15
+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
12
16
13
- error: functions with a C variable argument list must be unsafe
17
+ error: `...` is not supported for `extern "Rust"` functions
14
18
--> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
15
19
|
20
+ LL | unsafe extern "Rust" fn f1_3(...) {}
21
+ | ------------- ^^^
22
+ | |
23
+ | `extern "Rust"` because of this
24
+ |
25
+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
26
+
27
+ error: functions with a C variable argument list must be unsafe
28
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:15:30
29
+ |
16
30
LL | extern "C" fn f2_1(x: isize, ...) {}
17
31
| ^^^
18
32
|
@@ -22,7 +36,7 @@ LL | unsafe extern "C" fn f2_1(x: isize, ...) {}
22
36
| ++++++
23
37
24
38
error: functions with a C variable argument list must be unsafe
25
- --> $DIR/variadic-ffi-semantic-restrictions.rs:15 :20
39
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:18 :20
26
40
|
27
41
LL | extern "C" fn f2_2(...) {}
28
42
| ^^^
@@ -33,13 +47,13 @@ LL | unsafe extern "C" fn f2_2(...) {}
33
47
| ++++++
34
48
35
49
error: `...` must be the last argument of a C-variadic function
36
- --> $DIR/variadic-ffi-semantic-restrictions.rs:18 :20
50
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:21 :20
37
51
|
38
52
LL | extern "C" fn f2_3(..., x: isize) {}
39
53
| ^^^
40
54
41
55
error: functions with a C variable argument list must be unsafe
42
- --> $DIR/variadic-ffi-semantic-restrictions.rs:21 :30
56
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:24 :30
43
57
|
44
58
LL | extern "C" fn f3_1(x: isize, ...) {}
45
59
| ^^^
@@ -50,7 +64,7 @@ LL | unsafe extern "C" fn f3_1(x: isize, ...) {}
50
64
| ++++++
51
65
52
66
error: functions with a C variable argument list must be unsafe
53
- --> $DIR/variadic-ffi-semantic-restrictions.rs:24 :20
67
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:27 :20
54
68
|
55
69
LL | extern "C" fn f3_2(...) {}
56
70
| ^^^
@@ -61,25 +75,25 @@ LL | unsafe extern "C" fn f3_2(...) {}
61
75
| ++++++
62
76
63
77
error: `...` must be the last argument of a C-variadic function
64
- --> $DIR/variadic-ffi-semantic-restrictions.rs:27 :20
78
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :20
65
79
|
66
80
LL | extern "C" fn f3_3(..., x: isize) {}
67
81
| ^^^
68
82
69
83
error: functions cannot be both `const` and C-variadic
70
- --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :1
84
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:33 :1
71
85
|
72
86
LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
73
87
| ^^^^^ `const` because of this ^^^ C-variadic because of this
74
88
75
89
error: functions cannot be both `const` and C-variadic
76
- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :1
90
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :1
77
91
|
78
92
LL | const extern "C" fn f4_2(x: isize, ...) {}
79
93
| ^^^^^ `const` because of this ^^^ C-variadic because of this
80
94
81
95
error: functions with a C variable argument list must be unsafe
82
- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :36
96
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :36
83
97
|
84
98
LL | const extern "C" fn f4_2(x: isize, ...) {}
85
99
| ^^^
@@ -90,19 +104,19 @@ LL | const unsafe extern "C" fn f4_2(x: isize, ...) {}
90
104
| ++++++
91
105
92
106
error: `...` must be the last argument of a C-variadic function
93
- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :26
107
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :26
94
108
|
95
109
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
96
110
| ^^^
97
111
98
112
error: functions cannot be both `const` and C-variadic
99
- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :1
113
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :1
100
114
|
101
115
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
102
116
| ^^^^^ `const` because of this ^^^ C-variadic because of this
103
117
104
118
error: functions with a C variable argument list must be unsafe
105
- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :41
119
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :41
106
120
|
107
121
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
108
122
| ^^^
@@ -113,121 +127,121 @@ LL | const unsafe extern "C" fn f4_3(..., x: isize, ...) {}
113
127
| ++++++
114
128
115
129
error: `...` must be the last argument of a C-variadic function
116
- --> $DIR/variadic-ffi-semantic-restrictions.rs:45 :13
130
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:48 :13
117
131
|
118
132
LL | fn e_f2(..., x: isize);
119
133
| ^^^
120
134
121
135
error: associated functions cannot have a C variable argument list
122
- --> $DIR/variadic-ffi-semantic-restrictions.rs:52 :23
136
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:55 :23
123
137
|
124
138
LL | fn i_f1(x: isize, ...) {}
125
139
| ^^^
126
140
127
141
error: associated functions cannot have a C variable argument list
128
- --> $DIR/variadic-ffi-semantic-restrictions.rs:54 :13
142
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:57 :13
129
143
|
130
144
LL | fn i_f2(...) {}
131
145
| ^^^
132
146
133
147
error: `...` must be the last argument of a C-variadic function
134
- --> $DIR/variadic-ffi-semantic-restrictions.rs:56 :13
148
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
135
149
|
136
150
LL | fn i_f3(..., x: isize, ...) {}
137
151
| ^^^
138
152
139
153
error: associated functions cannot have a C variable argument list
140
- --> $DIR/variadic-ffi-semantic-restrictions.rs:56 :28
154
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :28
141
155
|
142
156
LL | fn i_f3(..., x: isize, ...) {}
143
157
| ^^^
144
158
145
159
error: `...` must be the last argument of a C-variadic function
146
- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
160
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
147
161
|
148
162
LL | fn i_f4(..., x: isize, ...) {}
149
163
| ^^^
150
164
151
165
error: associated functions cannot have a C variable argument list
152
- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :28
166
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :28
153
167
|
154
168
LL | fn i_f4(..., x: isize, ...) {}
155
169
| ^^^
156
170
157
171
error: functions cannot be both `const` and C-variadic
158
- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :5
172
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :5
159
173
|
160
174
LL | const fn i_f5(x: isize, ...) {}
161
175
| ^^^^^ ^^^ C-variadic because of this
162
176
| |
163
177
| `const` because of this
164
178
165
179
error: associated functions cannot have a C variable argument list
166
- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :29
180
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :29
167
181
|
168
182
LL | const fn i_f5(x: isize, ...) {}
169
183
| ^^^
170
184
171
185
error: associated functions cannot have a C variable argument list
172
- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :23
186
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :23
173
187
|
174
188
LL | fn t_f1(x: isize, ...) {}
175
189
| ^^^
176
190
177
191
error: associated functions cannot have a C variable argument list
178
- --> $DIR/variadic-ffi-semantic-restrictions.rs:71 :23
192
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74 :23
179
193
|
180
194
LL | fn t_f2(x: isize, ...);
181
195
| ^^^
182
196
183
197
error: associated functions cannot have a C variable argument list
184
- --> $DIR/variadic-ffi-semantic-restrictions.rs:73 :13
198
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:76 :13
185
199
|
186
200
LL | fn t_f3(...) {}
187
201
| ^^^
188
202
189
203
error: associated functions cannot have a C variable argument list
190
- --> $DIR/variadic-ffi-semantic-restrictions.rs:75 :13
204
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
191
205
|
192
206
LL | fn t_f4(...);
193
207
| ^^^
194
208
195
209
error: `...` must be the last argument of a C-variadic function
196
- --> $DIR/variadic-ffi-semantic-restrictions.rs:77 :13
210
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:80 :13
197
211
|
198
212
LL | fn t_f5(..., x: isize) {}
199
213
| ^^^
200
214
201
215
error: `...` must be the last argument of a C-variadic function
202
- --> $DIR/variadic-ffi-semantic-restrictions.rs:79 :13
216
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:82 :13
203
217
|
204
218
LL | fn t_f6(..., x: isize);
205
219
| ^^^
206
220
207
221
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
208
- --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :43
222
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:33 :43
209
223
|
210
224
LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
211
225
| ^^^ - value is dropped here
212
226
| |
213
227
| the destructor for this type cannot be evaluated in constant functions
214
228
215
229
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
216
- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :36
230
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :36
217
231
|
218
232
LL | const extern "C" fn f4_2(x: isize, ...) {}
219
233
| ^^^ - value is dropped here
220
234
| |
221
235
| the destructor for this type cannot be evaluated in constant functions
222
236
223
237
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
224
- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :29
238
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :29
225
239
|
226
240
LL | const fn i_f5(x: isize, ...) {}
227
241
| ^^^ - value is dropped here
228
242
| |
229
243
| the destructor for this type cannot be evaluated in constant functions
230
244
231
- error: aborting due to 32 previous errors
245
+ error: aborting due to 33 previous errors
232
246
233
247
For more information about this error, try `rustc --explain E0493`.
0 commit comments