Skip to content

Commit 622a1e4

Browse files
tests: Add struct, trait, impl to abi/unsupported.rs
1 parent ce14ce8 commit 622a1e4

7 files changed

+174
-6
lines changed

tests/ui/abi/unsupported.aarch64.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
204204
LL | extern "C-cmse-nonsecure-entry" {}
205205
| ^^^^^^^^^^^^^^^^^^^^^^^^
206206

207+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
208+
--> $DIR/unsupported.rs:165:17
209+
|
210+
LL | ptr: extern "thiscall" fn(),
211+
| ^^^^^^^^^^
212+
213+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
214+
--> $DIR/unsupported.rs:170:16
215+
|
216+
LL | pub extern "thiscall" fn inherent_fn(self) {
217+
| ^^^^^^^^^^
218+
219+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
220+
--> $DIR/unsupported.rs:177:12
221+
|
222+
LL | extern "thiscall" fn trait_fn(self);
223+
| ^^^^^^^^^^
224+
225+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
226+
--> $DIR/unsupported.rs:182:12
227+
|
228+
LL | extern "thiscall" fn trait_fn(self) {
229+
| ^^^^^^^^^^
230+
207231
warning: use of calling convention not supported on this target
208232
--> $DIR/unsupported.rs:123:17
209233
|
@@ -245,7 +269,7 @@ LL | extern "cdecl" fn cdecl() {}
245269
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
246270
= help: use `extern "C"` instead
247271

248-
error: aborting due to 33 previous errors; 4 warnings emitted
272+
error: aborting due to 37 previous errors; 4 warnings emitted
249273

250274
For more information about this error, try `rustc --explain E0570`.
251275
Future incompatibility report: Future breakage diagnostic:

tests/ui/abi/unsupported.arm.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
186186
LL | extern "C-cmse-nonsecure-entry" {}
187187
| ^^^^^^^^^^^^^^^^^^^^^^^^
188188

189+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
190+
--> $DIR/unsupported.rs:165:17
191+
|
192+
LL | ptr: extern "thiscall" fn(),
193+
| ^^^^^^^^^^
194+
195+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
196+
--> $DIR/unsupported.rs:170:16
197+
|
198+
LL | pub extern "thiscall" fn inherent_fn(self) {
199+
| ^^^^^^^^^^
200+
201+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
202+
--> $DIR/unsupported.rs:177:12
203+
|
204+
LL | extern "thiscall" fn trait_fn(self);
205+
| ^^^^^^^^^^
206+
207+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
208+
--> $DIR/unsupported.rs:182:12
209+
|
210+
LL | extern "thiscall" fn trait_fn(self) {
211+
| ^^^^^^^^^^
212+
189213
warning: use of calling convention not supported on this target
190214
--> $DIR/unsupported.rs:123:17
191215
|
@@ -227,7 +251,7 @@ LL | extern "cdecl" fn cdecl() {}
227251
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
228252
= help: use `extern "C"` instead
229253

230-
error: aborting due to 30 previous errors; 4 warnings emitted
254+
error: aborting due to 34 previous errors; 4 warnings emitted
231255

232256
For more information about this error, try `rustc --explain E0570`.
233257
Future incompatibility report: Future breakage diagnostic:

tests/ui/abi/unsupported.riscv32.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
186186
LL | extern "C-cmse-nonsecure-entry" {}
187187
| ^^^^^^^^^^^^^^^^^^^^^^^^
188188

189+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
190+
--> $DIR/unsupported.rs:165:17
191+
|
192+
LL | ptr: extern "thiscall" fn(),
193+
| ^^^^^^^^^^
194+
195+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
196+
--> $DIR/unsupported.rs:170:16
197+
|
198+
LL | pub extern "thiscall" fn inherent_fn(self) {
199+
| ^^^^^^^^^^
200+
201+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
202+
--> $DIR/unsupported.rs:177:12
203+
|
204+
LL | extern "thiscall" fn trait_fn(self);
205+
| ^^^^^^^^^^
206+
207+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
208+
--> $DIR/unsupported.rs:182:12
209+
|
210+
LL | extern "thiscall" fn trait_fn(self) {
211+
| ^^^^^^^^^^
212+
189213
warning: use of calling convention not supported on this target
190214
--> $DIR/unsupported.rs:123:17
191215
|
@@ -227,7 +251,7 @@ LL | extern "cdecl" fn cdecl() {}
227251
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
228252
= help: use `extern "C"` instead
229253

230-
error: aborting due to 30 previous errors; 4 warnings emitted
254+
error: aborting due to 34 previous errors; 4 warnings emitted
231255

232256
For more information about this error, try `rustc --explain E0570`.
233257
Future incompatibility report: Future breakage diagnostic:

tests/ui/abi/unsupported.riscv64.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
186186
LL | extern "C-cmse-nonsecure-entry" {}
187187
| ^^^^^^^^^^^^^^^^^^^^^^^^
188188

189+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
190+
--> $DIR/unsupported.rs:165:17
191+
|
192+
LL | ptr: extern "thiscall" fn(),
193+
| ^^^^^^^^^^
194+
195+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
196+
--> $DIR/unsupported.rs:170:16
197+
|
198+
LL | pub extern "thiscall" fn inherent_fn(self) {
199+
| ^^^^^^^^^^
200+
201+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
202+
--> $DIR/unsupported.rs:177:12
203+
|
204+
LL | extern "thiscall" fn trait_fn(self);
205+
| ^^^^^^^^^^
206+
207+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
208+
--> $DIR/unsupported.rs:182:12
209+
|
210+
LL | extern "thiscall" fn trait_fn(self) {
211+
| ^^^^^^^^^^
212+
189213
warning: use of calling convention not supported on this target
190214
--> $DIR/unsupported.rs:123:17
191215
|
@@ -227,7 +251,7 @@ LL | extern "cdecl" fn cdecl() {}
227251
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
228252
= help: use `extern "C"` instead
229253

230-
error: aborting due to 30 previous errors; 4 warnings emitted
254+
error: aborting due to 34 previous errors; 4 warnings emitted
231255

232256
For more information about this error, try `rustc --explain E0570`.
233257
Future incompatibility report: Future breakage diagnostic:

tests/ui/abi/unsupported.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,27 @@ extern "C-cmse-nonsecure-entry" {}
160160
extern "cdecl" {}
161161
//[x64_win]~^ WARN use of calling convention not supported on this target
162162
//[x64_win]~^^ WARN this was previously accepted
163+
164+
struct FnPtrBearer {
165+
ptr: extern "thiscall" fn(),
166+
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR: is not a supported ABI
167+
}
168+
169+
impl FnPtrBearer {
170+
pub extern "thiscall" fn inherent_fn(self) {
171+
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR: is not a supported ABI
172+
(self.ptr)()
173+
}
174+
}
175+
176+
trait Trait {
177+
extern "thiscall" fn trait_fn(self);
178+
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR: is not a supported ABI
179+
}
180+
181+
impl Trait for FnPtrBearer {
182+
extern "thiscall" fn trait_fn(self) {
183+
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR: is not a supported ABI
184+
self.inherent_fn()
185+
}
186+
}

tests/ui/abi/unsupported.x64.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
168168
LL | extern "C-cmse-nonsecure-entry" {}
169169
| ^^^^^^^^^^^^^^^^^^^^^^^^
170170

171+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
172+
--> $DIR/unsupported.rs:165:17
173+
|
174+
LL | ptr: extern "thiscall" fn(),
175+
| ^^^^^^^^^^
176+
177+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
178+
--> $DIR/unsupported.rs:170:16
179+
|
180+
LL | pub extern "thiscall" fn inherent_fn(self) {
181+
| ^^^^^^^^^^
182+
183+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
184+
--> $DIR/unsupported.rs:177:12
185+
|
186+
LL | extern "thiscall" fn trait_fn(self);
187+
| ^^^^^^^^^^
188+
189+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
190+
--> $DIR/unsupported.rs:182:12
191+
|
192+
LL | extern "thiscall" fn trait_fn(self) {
193+
| ^^^^^^^^^^
194+
171195
warning: use of calling convention not supported on this target
172196
--> $DIR/unsupported.rs:123:17
173197
|
@@ -209,7 +233,7 @@ LL | extern "cdecl" fn cdecl() {}
209233
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
210234
= help: use `extern "C"` instead
211235

212-
error: aborting due to 27 previous errors; 4 warnings emitted
236+
error: aborting due to 31 previous errors; 4 warnings emitted
213237

214238
For more information about this error, try `rustc --explain E0570`.
215239
Future incompatibility report: Future breakage diagnostic:

tests/ui/abi/unsupported.x64_win.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,30 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current
136136
LL | extern "C-cmse-nonsecure-entry" {}
137137
| ^^^^^^^^^^^^^^^^^^^^^^^^
138138

139+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
140+
--> $DIR/unsupported.rs:165:17
141+
|
142+
LL | ptr: extern "thiscall" fn(),
143+
| ^^^^^^^^^^
144+
145+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
146+
--> $DIR/unsupported.rs:170:16
147+
|
148+
LL | pub extern "thiscall" fn inherent_fn(self) {
149+
| ^^^^^^^^^^
150+
151+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
152+
--> $DIR/unsupported.rs:177:12
153+
|
154+
LL | extern "thiscall" fn trait_fn(self);
155+
| ^^^^^^^^^^
156+
157+
error[E0570]: `"thiscall"` is not a supported ABI for the current target
158+
--> $DIR/unsupported.rs:182:12
159+
|
160+
LL | extern "thiscall" fn trait_fn(self) {
161+
| ^^^^^^^^^^
162+
139163
warning: use of calling convention not supported on this target
140164
--> $DIR/unsupported.rs:105:19
141165
|
@@ -227,7 +251,7 @@ LL | extern "cdecl" fn cdecl() {}
227251
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
228252
= help: use `extern "C"` instead
229253

230-
error: aborting due to 23 previous errors; 9 warnings emitted
254+
error: aborting due to 27 previous errors; 9 warnings emitted
231255

232256
For more information about this error, try `rustc --explain E0570`.
233257
Future incompatibility report: Future breakage diagnostic:

0 commit comments

Comments
 (0)