Skip to content

Commit 9aecfc6

Browse files
tests: Verify unsupported varargs ABIs in fnptrs do not ICE
1 parent 15a693d commit 9aecfc6

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// FIXME(workingjubilee): add revisions and generalize to other platform-specific varargs ABIs,
2+
// preferably after the only-arch directive is enhanced with an "or pattern" syntax
3+
//@ only-x86_64
4+
//@ build-pass
5+
6+
#![feature(extended_varargs_abi_support)]
7+
8+
// sometimes fn ptrs with varargs make layout and ABI computation ICE
9+
// as found in https://github.com/rust-lang/rust/issues/142107
10+
11+
fn aapcs(f: extern "aapcs" fn(usize, ...)) {
12+
//~^ warning: the calling convention "aapcs" is not supported on this target
13+
//~| warning: this was previously accepted by the compiler but is being phased out
14+
f(22, 44);
15+
}
16+
17+
18+
fn main() {}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
warning: the calling convention "aapcs" is not supported on this target
2+
--> $DIR/unsupported-varargs-fnptr.rs:7:13
3+
|
4+
LL | fn aapcs(f: extern "aapcs" fn(usize, ...)) {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
9+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
10+
11+
warning: 1 warning emitted
12+
13+
Future incompatibility report: Future breakage diagnostic:
14+
warning: the calling convention "aapcs" is not supported on this target
15+
--> $DIR/unsupported-varargs-fnptr.rs:7:13
16+
|
17+
LL | fn aapcs(f: extern "aapcs" fn(usize, ...)) {
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
|
20+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
21+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
22+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
23+

0 commit comments

Comments
 (0)