@@ -76,119 +76,171 @@ error: only foreign or `unsafe extern "C"` functions may be C-variadic
76
76
LL | extern "C" fn f3_3(..., x: isize) {}
77
77
| ^^^
78
78
79
+ error: functions cannot be both `const` and C-variadic
80
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:35:1
81
+ |
82
+ LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
83
+ | ^^^^^ `const` because of this ^^^ C-variadic because of this
84
+
85
+ error: functions cannot be both `const` and C-variadic
86
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:38:1
87
+ |
88
+ LL | const extern "C" fn f4_2(x: isize, ...) {}
89
+ | ^^^^^ `const` because of this ^^^ C-variadic because of this
90
+
91
+ error: only foreign or `unsafe extern "C"` functions may be C-variadic
92
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:38:36
93
+ |
94
+ LL | const extern "C" fn f4_2(x: isize, ...) {}
95
+ | ^^^
96
+
97
+ error: `...` must be the last argument of a C-variadic function
98
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:26
99
+ |
100
+ LL | const extern "C" fn f4_3(..., x: isize, ...) {}
101
+ | ^^^
102
+
103
+ error: functions cannot be both `const` and C-variadic
104
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:1
105
+ |
106
+ LL | const extern "C" fn f4_3(..., x: isize, ...) {}
107
+ | ^^^^^ ^^^ C-variadic because of this
108
+ | |
109
+ | `const` because of this
110
+
111
+ error: only foreign or `unsafe extern "C"` functions may be C-variadic
112
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:26
113
+ |
114
+ LL | const extern "C" fn f4_3(..., x: isize, ...) {}
115
+ | ^^^
116
+
79
117
error: C-variadic function must be declared with at least one named argument
80
- --> $DIR/variadic-ffi-semantic-restrictions.rs:36 :13
118
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:48 :13
81
119
|
82
120
LL | fn e_f1(...);
83
121
| ^^^
84
122
85
123
error: `...` must be the last argument of a C-variadic function
86
- --> $DIR/variadic-ffi-semantic-restrictions.rs:38 :13
124
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:50 :13
87
125
|
88
126
LL | fn e_f2(..., x: isize);
89
127
| ^^^
90
128
91
129
error: only foreign or `unsafe extern "C"` functions may be C-variadic
92
- --> $DIR/variadic-ffi-semantic-restrictions.rs:45 :23
130
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:57 :23
93
131
|
94
132
LL | fn i_f1(x: isize, ...) {}
95
133
| ^^^
96
134
97
135
error: C-variadic function must be declared with at least one named argument
98
- --> $DIR/variadic-ffi-semantic-restrictions.rs:47 :13
136
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
99
137
|
100
138
LL | fn i_f2(...) {}
101
139
| ^^^
102
140
103
141
error: only foreign or `unsafe extern "C"` functions may be C-variadic
104
- --> $DIR/variadic-ffi-semantic-restrictions.rs:47 :13
142
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
105
143
|
106
144
LL | fn i_f2(...) {}
107
145
| ^^^
108
146
109
147
error: `...` must be the last argument of a C-variadic function
110
- --> $DIR/variadic-ffi-semantic-restrictions.rs:50 :13
148
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
111
149
|
112
150
LL | fn i_f3(..., x: isize, ...) {}
113
151
| ^^^
114
152
115
153
error: only foreign or `unsafe extern "C"` functions may be C-variadic
116
- --> $DIR/variadic-ffi-semantic-restrictions.rs:50 :13
154
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
117
155
|
118
156
LL | fn i_f3(..., x: isize, ...) {}
119
157
| ^^^
120
158
121
159
error: `...` must be the last argument of a C-variadic function
122
- --> $DIR/variadic-ffi-semantic-restrictions.rs:53 :13
160
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :13
123
161
|
124
162
LL | fn i_f4(..., x: isize, ...) {}
125
163
| ^^^
126
164
127
165
error: only foreign or `unsafe extern "C"` functions may be C-variadic
128
- --> $DIR/variadic-ffi-semantic-restrictions.rs:53 :13
166
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :13
129
167
|
130
168
LL | fn i_f4(..., x: isize, ...) {}
131
169
| ^^^
132
170
171
+ error: functions cannot be both `const` and C-variadic
172
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:5
173
+ |
174
+ LL | const fn i_f5(x: isize, ...) {}
175
+ | ^^^^^ ^^^ C-variadic because of this
176
+ | |
177
+ | `const` because of this
178
+
179
+ error: only foreign or `unsafe extern "C"` functions may be C-variadic
180
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:29
181
+ |
182
+ LL | const fn i_f5(x: isize, ...) {}
183
+ | ^^^
184
+
133
185
error: only foreign or `unsafe extern "C"` functions may be C-variadic
134
- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :23
186
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74 :23
135
187
|
136
188
LL | fn t_f1(x: isize, ...) {}
137
189
| ^^^
138
190
139
191
error: only foreign or `unsafe extern "C"` functions may be C-variadic
140
- --> $DIR/variadic-ffi-semantic-restrictions.rs:61 :23
192
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:76 :23
141
193
|
142
194
LL | fn t_f2(x: isize, ...);
143
195
| ^^^
144
196
145
197
error: C-variadic function must be declared with at least one named argument
146
- --> $DIR/variadic-ffi-semantic-restrictions.rs:63 :13
198
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
147
199
|
148
200
LL | fn t_f3(...) {}
149
201
| ^^^
150
202
151
203
error: only foreign or `unsafe extern "C"` functions may be C-variadic
152
- --> $DIR/variadic-ffi-semantic-restrictions.rs:63 :13
204
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
153
205
|
154
206
LL | fn t_f3(...) {}
155
207
| ^^^
156
208
157
209
error: C-variadic function must be declared with at least one named argument
158
- --> $DIR/variadic-ffi-semantic-restrictions.rs:66 :13
210
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81 :13
159
211
|
160
212
LL | fn t_f4(...);
161
213
| ^^^
162
214
163
215
error: only foreign or `unsafe extern "C"` functions may be C-variadic
164
- --> $DIR/variadic-ffi-semantic-restrictions.rs:66 :13
216
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81 :13
165
217
|
166
218
LL | fn t_f4(...);
167
219
| ^^^
168
220
169
221
error: `...` must be the last argument of a C-variadic function
170
- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :13
222
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84 :13
171
223
|
172
224
LL | fn t_f5(..., x: isize) {}
173
225
| ^^^
174
226
175
227
error: only foreign or `unsafe extern "C"` functions may be C-variadic
176
- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :13
228
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84 :13
177
229
|
178
230
LL | fn t_f5(..., x: isize) {}
179
231
| ^^^
180
232
181
233
error: `...` must be the last argument of a C-variadic function
182
- --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :13
234
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87 :13
183
235
|
184
236
LL | fn t_f6(..., x: isize);
185
237
| ^^^
186
238
187
239
error: only foreign or `unsafe extern "C"` functions may be C-variadic
188
- --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :13
240
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87 :13
189
241
|
190
242
LL | fn t_f6(..., x: isize);
191
243
| ^^^
192
244
193
- error: aborting due to 32 previous errors
245
+ error: aborting due to 40 previous errors
194
246
0 commit comments