Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions compiler/rustc_target/src/spec/abi_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ impl AbiMap {
Arch::Msp430 => ArchKind::Msp430,
Arch::Nvptx64 => ArchKind::Nvptx,
Arch::RiscV32 | Arch::RiscV64 => ArchKind::Riscv,
Arch::SpirV => ArchKind::Spirv,
Arch::Wasm32 | Arch::Wasm64 => ArchKind::Wasm,
Arch::X86 => ArchKind::X86,
Arch::X86_64 => ArchKind::X86_64,
_ => ArchKind::Other,
Expand Down Expand Up @@ -102,8 +104,6 @@ impl AbiMap {
(ExternAbi::RustPreserveNone, _) => CanonAbi::RustPreserveNone,
(ExternAbi::RustTail, _) => CanonAbi::RustTail,

(ExternAbi::Custom, _) => CanonAbi::Custom,

(ExternAbi::Swift, _) => CanonAbi::Swift,

(ExternAbi::System { .. }, ArchKind::X86)
Expand All @@ -122,6 +122,9 @@ impl AbiMap {
// always and forever
(ExternAbi::RustInvalid, _) => return AbiMapping::Invalid,

(ExternAbi::Custom, ArchKind::Wasm | ArchKind::Spirv) => return AbiMapping::Invalid,
(ExternAbi::Custom, _) => CanonAbi::Custom,

(ExternAbi::EfiApi, ArchKind::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
(ExternAbi::EfiApi, ArchKind::X86_64) => CanonAbi::X86(X86Call::Win64),
(
Expand Down Expand Up @@ -221,6 +224,8 @@ enum ArchKind {
Riscv,
X86,
X86_64,
Wasm,
Spirv,
/// Architectures which don't need other considerations for ABI lowering
Other,
}
Expand Down
58 changes: 29 additions & 29 deletions tests/ui/abi/unsupported.aarch64.stderr
Original file line number Diff line number Diff line change
@@ -1,163 +1,163 @@
error[E0570]: "ptx-kernel" is not a supported ABI for the current target
--> $DIR/unsupported.rs:37:8
--> $DIR/unsupported.rs:42:8
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^

error[E0570]: "ptx-kernel" is not a supported ABI for the current target
--> $DIR/unsupported.rs:39:22
--> $DIR/unsupported.rs:44:22
|
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
| ^^^^^^^^^^^^

error[E0570]: "ptx-kernel" is not a supported ABI for the current target
--> $DIR/unsupported.rs:43:8
--> $DIR/unsupported.rs:48:8
|
LL | extern "ptx-kernel" {}
| ^^^^^^^^^^^^

error[E0570]: "gpu-kernel" is not a supported ABI for the current target
--> $DIR/unsupported.rs:45:8
--> $DIR/unsupported.rs:50:8
|
LL | extern "gpu-kernel" fn gpu() {}
| ^^^^^^^^^^^^

error[E0570]: "aapcs" is not a supported ABI for the current target
--> $DIR/unsupported.rs:48:8
--> $DIR/unsupported.rs:53:8
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^

error[E0570]: "aapcs" is not a supported ABI for the current target
--> $DIR/unsupported.rs:50:24
--> $DIR/unsupported.rs:55:24
|
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
| ^^^^^^^

error[E0570]: "aapcs" is not a supported ABI for the current target
--> $DIR/unsupported.rs:54:8
--> $DIR/unsupported.rs:59:8
|
LL | extern "aapcs" {}
| ^^^^^^^

error[E0570]: "msp430-interrupt" is not a supported ABI for the current target
--> $DIR/unsupported.rs:57:8
--> $DIR/unsupported.rs:62:8
|
LL | extern "msp430-interrupt" {}
| ^^^^^^^^^^^^^^^^^^

error[E0570]: "avr-interrupt" is not a supported ABI for the current target
--> $DIR/unsupported.rs:60:8
--> $DIR/unsupported.rs:65:8
|
LL | extern "avr-interrupt" {}
| ^^^^^^^^^^^^^^^

error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target
--> $DIR/unsupported.rs:63:8
--> $DIR/unsupported.rs:68:8
|
LL | extern "riscv-interrupt-m" {}
| ^^^^^^^^^^^^^^^^^^^

error[E0570]: "x86-interrupt" is not a supported ABI for the current target
--> $DIR/unsupported.rs:66:8
--> $DIR/unsupported.rs:71:8
|
LL | extern "x86-interrupt" {}
| ^^^^^^^^^^^^^^^

error[E0570]: "thiscall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:69:8
--> $DIR/unsupported.rs:74:8
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^

error[E0570]: "thiscall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:71:27
--> $DIR/unsupported.rs:76:27
|
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
| ^^^^^^^^^^

error[E0570]: "thiscall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:75:8
--> $DIR/unsupported.rs:80:8
|
LL | extern "thiscall" {}
| ^^^^^^^^^^

error[E0570]: "stdcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:78:8
--> $DIR/unsupported.rs:83:8
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^
|
= help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"`

error[E0570]: "stdcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:82:26
--> $DIR/unsupported.rs:87:26
|
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
| ^^^^^^^^^
|
= help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"`

error[E0570]: "stdcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:88:8
--> $DIR/unsupported.rs:93:8
|
LL | extern "stdcall" {}
| ^^^^^^^^^
|
= help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"`

error[E0570]: "stdcall-unwind" is not a supported ABI for the current target
--> $DIR/unsupported.rs:92:8
--> $DIR/unsupported.rs:97:8
|
LL | extern "stdcall-unwind" {}
| ^^^^^^^^^^^^^^^^
|
= help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"`

error[E0570]: "vectorcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:112:8
--> $DIR/unsupported.rs:117:8
|
LL | extern "vectorcall" fn vectorcall() {}
| ^^^^^^^^^^^^

error[E0570]: "vectorcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:114:29
--> $DIR/unsupported.rs:119:29
|
LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) {
| ^^^^^^^^^^^^

error[E0570]: "vectorcall" is not a supported ABI for the current target
--> $DIR/unsupported.rs:118:8
--> $DIR/unsupported.rs:123:8
|
LL | extern "vectorcall" {}
| ^^^^^^^^^^^^

error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target
--> $DIR/unsupported.rs:121:28
--> $DIR/unsupported.rs:126:28
|
LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) {
| ^^^^^^^^^^^^^^^^^^^^^

error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target
--> $DIR/unsupported.rs:126:8
--> $DIR/unsupported.rs:131:8
|
LL | extern "cmse-nonsecure-entry" fn cmse_entry() {}
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target
--> $DIR/unsupported.rs:128:29
--> $DIR/unsupported.rs:133:29
|
LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) {
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target
--> $DIR/unsupported.rs:132:8
--> $DIR/unsupported.rs:137:8
|
LL | extern "cmse-nonsecure-entry" {}
| ^^^^^^^^^^^^^^^^^^^^^^

warning: "cdecl" is not a supported ABI for the current target
--> $DIR/unsupported.rs:100:17
--> $DIR/unsupported.rs:105:17
|
LL | fn cdecl_ptr(f: extern "cdecl" fn()) {
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -168,7 +168,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) {
= note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default

warning: "cdecl" is not a supported ABI for the current target
--> $DIR/unsupported.rs:105:1
--> $DIR/unsupported.rs:110:1
|
LL | extern "cdecl" {}
| ^^^^^^^^^^^^^^^^^
Expand All @@ -178,7 +178,7 @@ LL | extern "cdecl" {}
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>

warning: "cdecl-unwind" is not a supported ABI for the current target
--> $DIR/unsupported.rs:108:1
--> $DIR/unsupported.rs:113:1
|
LL | extern "cdecl-unwind" {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -188,7 +188,7 @@ LL | extern "cdecl-unwind" {}
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>

warning: "cdecl" is not a supported ABI for the current target
--> $DIR/unsupported.rs:97:1
--> $DIR/unsupported.rs:102:1
|
LL | extern "cdecl" fn cdecl() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading
Loading