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