Closed
Description
Currently the following code compiles fine when targetting x86_64.
pub extern "aapcs" fn foo() {}
This code is non-sensical because AAPCS calling convention is only defined for ARM. An example of non-sensical ABI being disallowed is
pub extern "fastcall" fn foo() {}
when compiling with --target=armv7-unknown-linux-gnueabihf
which fails with:
error[E0570]: The ABI `"fastcall"` is not supported for the current target
--> <source>:6:1
|
6 | / extern "fastcall" fn foo() {
7 | | }
| |_^
Targets should be reviewed for such nonsensical ABIs and their blacklists updated. I feel that to avoid this issue in the future we should rather prefer a whitelist of ABIs, rather than a blacklist, and by default put no ABIs, so that the compilation fails until the ABI list is properly populated for the target.