@@ -76,119 +76,171 @@ error: only foreign or `unsafe extern "C"` functions may be C-variadic
7676LL | extern "C" fn f3_3(..., x: isize) {}
7777 | ^^^
7878
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+
79117error: 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
81119 |
82120LL | fn e_f1(...);
83121 | ^^^
84122
85123error: `...` 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
87125 |
88126LL | fn e_f2(..., x: isize);
89127 | ^^^
90128
91129error: 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
93131 |
94132LL | fn i_f1(x: isize, ...) {}
95133 | ^^^
96134
97135error: 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
99137 |
100138LL | fn i_f2(...) {}
101139 | ^^^
102140
103141error: 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
105143 |
106144LL | fn i_f2(...) {}
107145 | ^^^
108146
109147error: `...` 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
111149 |
112150LL | fn i_f3(..., x: isize, ...) {}
113151 | ^^^
114152
115153error: 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
117155 |
118156LL | fn i_f3(..., x: isize, ...) {}
119157 | ^^^
120158
121159error: `...` 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
123161 |
124162LL | fn i_f4(..., x: isize, ...) {}
125163 | ^^^
126164
127165error: 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
129167 |
130168LL | fn i_f4(..., x: isize, ...) {}
131169 | ^^^
132170
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+
133185error: 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
135187 |
136188LL | fn t_f1(x: isize, ...) {}
137189 | ^^^
138190
139191error: 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
141193 |
142194LL | fn t_f2(x: isize, ...);
143195 | ^^^
144196
145197error: 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
147199 |
148200LL | fn t_f3(...) {}
149201 | ^^^
150202
151203error: 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
153205 |
154206LL | fn t_f3(...) {}
155207 | ^^^
156208
157209error: 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
159211 |
160212LL | fn t_f4(...);
161213 | ^^^
162214
163215error: 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
165217 |
166218LL | fn t_f4(...);
167219 | ^^^
168220
169221error: `...` 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
171223 |
172224LL | fn t_f5(..., x: isize) {}
173225 | ^^^
174226
175227error: 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
177229 |
178230LL | fn t_f5(..., x: isize) {}
179231 | ^^^
180232
181233error: `...` 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
183235 |
184236LL | fn t_f6(..., x: isize);
185237 | ^^^
186238
187239error: 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
189241 |
190242LL | fn t_f6(..., x: isize);
191243 | ^^^
192244
193- error: aborting due to 32 previous errors
245+ error: aborting due to 40 previous errors
194246
0 commit comments