@@ -76,119 +76,172 @@ 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+ | | 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+
79118error: 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
81120 |
82121LL | fn e_f1(...);
83122 | ^^^
84123
85124error: `...` 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
87126 |
88127LL | fn e_f2(..., x: isize);
89128 | ^^^
90129
91130error: 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
93132 |
94133LL | fn i_f1(x: isize, ...) {}
95134 | ^^^
96135
97136error: 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
99138 |
100139LL | fn i_f2(...) {}
101140 | ^^^
102141
103142error: 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
105144 |
106145LL | fn i_f2(...) {}
107146 | ^^^
108147
109148error: `...` must be the last argument of a C-variadic function
110- --> $DIR/variadic-ffi-semantic-restrictions.rs:50 :13
149+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
111150 |
112151LL | fn i_f3(..., x: isize, ...) {}
113152 | ^^^
114153
115154error: only foreign or `unsafe extern "C"` functions may be C-variadic
116- --> $DIR/variadic-ffi-semantic-restrictions.rs:50 :13
155+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
117156 |
118157LL | fn i_f3(..., x: isize, ...) {}
119158 | ^^^ ^^^
120159
121160error: `...` must be the last argument of a C-variadic function
122- --> $DIR/variadic-ffi-semantic-restrictions.rs:53 :13
161+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :13
123162 |
124163LL | fn i_f4(..., x: isize, ...) {}
125164 | ^^^
126165
127166error: only foreign or `unsafe extern "C"` functions may be C-variadic
128- --> $DIR/variadic-ffi-semantic-restrictions.rs:53 :13
167+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :13
129168 |
130169LL | fn i_f4(..., x: isize, ...) {}
131170 | ^^^ ^^^
132171
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
179+
180+ error: only foreign or `unsafe extern "C"` functions may be C-variadic
181+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:29
182+ |
183+ LL | const fn i_f5(x: isize, ...) {}
184+ | ^^^
185+
133186error: only foreign or `unsafe extern "C"` functions may be C-variadic
134- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :23
187+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74 :23
135188 |
136189LL | fn t_f1(x: isize, ...) {}
137190 | ^^^
138191
139192error: only foreign or `unsafe extern "C"` functions may be C-variadic
140- --> $DIR/variadic-ffi-semantic-restrictions.rs:61 :23
193+ --> $DIR/variadic-ffi-semantic-restrictions.rs:76 :23
141194 |
142195LL | fn t_f2(x: isize, ...);
143196 | ^^^
144197
145198error: C-variadic function must be declared with at least one named argument
146- --> $DIR/variadic-ffi-semantic-restrictions.rs:63 :13
199+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
147200 |
148201LL | fn t_f3(...) {}
149202 | ^^^
150203
151204error: only foreign or `unsafe extern "C"` functions may be C-variadic
152- --> $DIR/variadic-ffi-semantic-restrictions.rs:63 :13
205+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
153206 |
154207LL | fn t_f3(...) {}
155208 | ^^^
156209
157210error: C-variadic function must be declared with at least one named argument
158- --> $DIR/variadic-ffi-semantic-restrictions.rs:66 :13
211+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81 :13
159212 |
160213LL | fn t_f4(...);
161214 | ^^^
162215
163216error: only foreign or `unsafe extern "C"` functions may be C-variadic
164- --> $DIR/variadic-ffi-semantic-restrictions.rs:66 :13
217+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81 :13
165218 |
166219LL | fn t_f4(...);
167220 | ^^^
168221
169222error: `...` must be the last argument of a C-variadic function
170- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :13
223+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84 :13
171224 |
172225LL | fn t_f5(..., x: isize) {}
173226 | ^^^
174227
175228error: only foreign or `unsafe extern "C"` functions may be C-variadic
176- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :13
229+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84 :13
177230 |
178231LL | fn t_f5(..., x: isize) {}
179232 | ^^^
180233
181234error: `...` must be the last argument of a C-variadic function
182- --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :13
235+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87 :13
183236 |
184237LL | fn t_f6(..., x: isize);
185238 | ^^^
186239
187240error: only foreign or `unsafe extern "C"` functions may be C-variadic
188- --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :13
241+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87 :13
189242 |
190243LL | fn t_f6(..., x: isize);
191244 | ^^^
192245
193- error: aborting due to 32 previous errors
246+ error: aborting due to 40 previous errors
194247
0 commit comments