Skip to content

Commit e7e5202

Browse files
committedJan 15, 2025··
Add gpu-kernel calling convention
The amdgpu-kernel calling convention was reverted in commit f6b21e9 due to inactivity in the amdgpu target. Introduce a `gpu-kernel` calling convention that translates to `ptx_kernel` or `amdgpu_kernel`, depending on the target that rust compiles for.
1 parent bf6f8a4 commit e7e5202

File tree

29 files changed

+435
-175
lines changed

29 files changed

+435
-175
lines changed
 

‎compiler/rustc_abi/src/extern_abi/mod.rs

+22-13
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ pub enum ExternAbi {
4545
PtxKernel,
4646
Msp430Interrupt,
4747
X86Interrupt,
48+
/// An entry-point function called by the GPU's host
49+
// FIXME: should not be callable from Rust on GPU targets, is for host's use only
50+
GpuKernel,
4851
EfiApi,
4952
AvrInterrupt,
5053
AvrNonBlockingInterrupt,
@@ -122,6 +125,7 @@ const AbiDatas: &[AbiData] = &[
122125
AbiData { abi: Abi::PtxKernel, name: "ptx-kernel" },
123126
AbiData { abi: Abi::Msp430Interrupt, name: "msp430-interrupt" },
124127
AbiData { abi: Abi::X86Interrupt, name: "x86-interrupt" },
128+
AbiData { abi: Abi::GpuKernel, name: "gpu-kernel" },
125129
AbiData { abi: Abi::EfiApi, name: "efiapi" },
126130
AbiData { abi: Abi::AvrInterrupt, name: "avr-interrupt" },
127131
AbiData { abi: Abi::AvrNonBlockingInterrupt, name: "avr-non-blocking-interrupt" },
@@ -235,6 +239,10 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
235239
feature: sym::abi_x86_interrupt,
236240
explain: "x86-interrupt ABI is experimental and subject to change",
237241
}),
242+
"gpu-kernel" => Err(AbiDisabled::Unstable {
243+
feature: sym::abi_gpu_kernel,
244+
explain: "gpu-kernel ABI is experimental and subject to change",
245+
}),
238246
"avr-interrupt" | "avr-non-blocking-interrupt" => Err(AbiDisabled::Unstable {
239247
feature: sym::abi_avr_interrupt,
240248
explain: "avr-interrupt and avr-non-blocking-interrupt ABIs are experimental and subject to change",
@@ -289,20 +297,21 @@ impl Abi {
289297
PtxKernel => 19,
290298
Msp430Interrupt => 20,
291299
X86Interrupt => 21,
292-
EfiApi => 22,
293-
AvrInterrupt => 23,
294-
AvrNonBlockingInterrupt => 24,
295-
CCmseNonSecureCall => 25,
296-
CCmseNonSecureEntry => 26,
300+
GpuKernel => 22,
301+
EfiApi => 23,
302+
AvrInterrupt => 24,
303+
AvrNonBlockingInterrupt => 25,
304+
CCmseNonSecureCall => 26,
305+
CCmseNonSecureEntry => 27,
297306
// Cross-platform ABIs
298-
System { unwind: false } => 27,
299-
System { unwind: true } => 28,
300-
RustIntrinsic => 29,
301-
RustCall => 30,
302-
Unadjusted => 31,
303-
RustCold => 32,
304-
RiscvInterruptM => 33,
305-
RiscvInterruptS => 34,
307+
System { unwind: false } => 28,
308+
System { unwind: true } => 29,
309+
RustIntrinsic => 30,
310+
RustCall => 31,
311+
Unadjusted => 32,
312+
RustCold => 33,
313+
RiscvInterruptM => 34,
314+
RiscvInterruptS => 35,
306315
};
307316
debug_assert!(
308317
AbiDatas

‎compiler/rustc_codegen_cranelift/src/abi/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ pub(crate) fn conv_to_call_conv(sess: &Session, c: Conv, default_call_conv: Call
6565
sess.dcx().fatal("C-cmse-nonsecure-entry call conv is not yet implemented");
6666
}
6767

68-
Conv::Msp430Intr | Conv::PtxKernel | Conv::AvrInterrupt | Conv::AvrNonBlockingInterrupt => {
68+
Conv::Msp430Intr
69+
| Conv::PtxKernel
70+
| Conv::GpuKernel
71+
| Conv::AvrInterrupt
72+
| Conv::AvrNonBlockingInterrupt => {
6973
unreachable!("tried to use {c:?} call conv which only exists on an unsupported target");
7074
}
7175
}

‎compiler/rustc_codegen_llvm/src/abi.rs

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::borrow::Borrow;
12
use std::cmp;
23

34
use libc::c_uint;
@@ -312,7 +313,7 @@ impl<'ll, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
312313
pub(crate) trait FnAbiLlvmExt<'ll, 'tcx> {
313314
fn llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type;
314315
fn ptr_to_llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type;
315-
fn llvm_cconv(&self) -> llvm::CallConv;
316+
fn llvm_cconv(&self, cx: &CodegenCx<'ll, 'tcx>) -> llvm::CallConv;
316317

317318
/// Apply attributes to a function declaration/definition.
318319
fn apply_attrs_llfn(
@@ -404,8 +405,8 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
404405
cx.type_ptr_ext(cx.data_layout().instruction_address_space)
405406
}
406407

407-
fn llvm_cconv(&self) -> llvm::CallConv {
408-
self.conv.into()
408+
fn llvm_cconv(&self, cx: &CodegenCx<'ll, 'tcx>) -> llvm::CallConv {
409+
llvm::CallConv::from_conv(self.conv, cx.tcx.sess.target.arch.borrow())
409410
}
410411

411412
fn apply_attrs_llfn(
@@ -617,7 +618,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
617618
}
618619
}
619620

620-
let cconv = self.llvm_cconv();
621+
let cconv = self.llvm_cconv(&bx.cx);
621622
if cconv != llvm::CCallConv {
622623
llvm::SetInstructionCallConv(callsite, cconv);
623624
}
@@ -655,8 +656,8 @@ impl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
655656
}
656657
}
657658

658-
impl From<Conv> for llvm::CallConv {
659-
fn from(conv: Conv) -> Self {
659+
impl llvm::CallConv {
660+
pub fn from_conv(conv: Conv, arch: &str) -> Self {
660661
match conv {
661662
Conv::C
662663
| Conv::Rust
@@ -666,6 +667,15 @@ impl From<Conv> for llvm::CallConv {
666667
Conv::Cold => llvm::ColdCallConv,
667668
Conv::PreserveMost => llvm::PreserveMost,
668669
Conv::PreserveAll => llvm::PreserveAll,
670+
Conv::GpuKernel => {
671+
if arch == "amdgpu" {
672+
llvm::AmdgpuKernel
673+
} else if arch == "nvptx64" {
674+
llvm::PtxKernel
675+
} else {
676+
panic!("Architecture {arch} does not support GpuKernel calling convention");
677+
}
678+
}
669679
Conv::AvrInterrupt => llvm::AvrInterrupt,
670680
Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt,
671681
Conv::ArmAapcs => llvm::ArmAapcsCallConv,

‎compiler/rustc_codegen_llvm/src/context.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,10 @@ impl<'ll, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
741741
if self.get_declared_value(entry_name).is_none() {
742742
Some(self.declare_entry_fn(
743743
entry_name,
744-
self.sess().target.entry_abi.into(),
744+
llvm::CallConv::from_conv(
745+
self.sess().target.entry_abi,
746+
self.sess().target.arch.borrow(),
747+
),
745748
llvm::UnnamedAddr::Global,
746749
fn_type,
747750
))

‎compiler/rustc_codegen_llvm/src/declare.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
125125
let llfn = declare_raw_fn(
126126
self,
127127
name,
128-
fn_abi.llvm_cconv(),
128+
fn_abi.llvm_cconv(self),
129129
llvm::UnnamedAddr::Global,
130130
llvm::Visibility::Default,
131131
fn_abi.llvm_type(self),

‎compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ pub enum CallConv {
120120
X86_Intr = 83,
121121
AvrNonBlockingInterrupt = 84,
122122
AvrInterrupt = 85,
123+
AmdgpuKernel = 91,
123124
}
124125

125126
/// Must match the layout of `LLVMLinkage`.

‎compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ declare_features! (
359359
(unstable, abi_avr_interrupt, "1.45.0", Some(69664)),
360360
/// Allows `extern "C-cmse-nonsecure-call" fn()`.
361361
(unstable, abi_c_cmse_nonsecure_call, "1.51.0", Some(81391)),
362+
/// Allows `extern "gpu-kernel" fn()`.
363+
(unstable, abi_gpu_kernel, "CURRENT_RUSTC_VERSION", Some(135467)),
362364
/// Allows `extern "msp430-interrupt" fn()`.
363365
(unstable, abi_msp430_interrupt, "1.16.0", Some(38487)),
364366
/// Allows `extern "ptx-*" fn()`.

‎compiler/rustc_middle/src/ty/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: ExternAbi)
12401240
PtxKernel
12411241
| Msp430Interrupt
12421242
| X86Interrupt
1243+
| GpuKernel
12431244
| EfiApi
12441245
| AvrInterrupt
12451246
| AvrNonBlockingInterrupt

‎compiler/rustc_smir/src/rustc_internal/internal.rs

+1
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ impl RustcInternal for Abi {
472472
Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel,
473473
Abi::Msp430Interrupt => rustc_abi::ExternAbi::Msp430Interrupt,
474474
Abi::X86Interrupt => rustc_abi::ExternAbi::X86Interrupt,
475+
Abi::GpuKernel => rustc_abi::ExternAbi::GpuKernel,
475476
Abi::EfiApi => rustc_abi::ExternAbi::EfiApi,
476477
Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt,
477478
Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt,

‎compiler/rustc_smir/src/rustc_smir/convert/abi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl<'tcx> Stable<'tcx> for callconv::Conv {
113113
Conv::X86VectorCall => CallConvention::X86VectorCall,
114114
Conv::X86_64SysV => CallConvention::X86_64SysV,
115115
Conv::X86_64Win64 => CallConvention::X86_64Win64,
116+
Conv::GpuKernel => CallConvention::GpuKernel,
116117
Conv::AvrInterrupt => CallConvention::AvrInterrupt,
117118
Conv::AvrNonBlockingInterrupt => CallConvention::AvrNonBlockingInterrupt,
118119
Conv::RiscvInterrupt { .. } => CallConvention::RiscvInterrupt,

‎compiler/rustc_smir/src/rustc_smir/convert/ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::ExternAbi {
911911
ExternAbi::Win64 { unwind } => Abi::Win64 { unwind },
912912
ExternAbi::SysV64 { unwind } => Abi::SysV64 { unwind },
913913
ExternAbi::PtxKernel => Abi::PtxKernel,
914+
ExternAbi::GpuKernel => Abi::GpuKernel,
914915
ExternAbi::Msp430Interrupt => Abi::Msp430Interrupt,
915916
ExternAbi::X86Interrupt => Abi::X86Interrupt,
916917
ExternAbi::EfiApi => Abi::EfiApi,

‎compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ symbols! {
379379
abi_avr_interrupt,
380380
abi_c_cmse_nonsecure_call,
381381
abi_efiapi,
382+
abi_gpu_kernel,
382383
abi_msp430_interrupt,
383384
abi_ptx,
384385
abi_riscv_interrupt,

‎compiler/rustc_target/src/callconv/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ pub enum Conv {
547547

548548
PtxKernel,
549549

550+
GpuKernel,
551+
550552
X86Fastcall,
551553
X86Intr,
552554
X86Stdcall,
@@ -866,6 +868,7 @@ impl FromStr for Conv {
866868
"X86VectorCall" => Ok(Conv::X86VectorCall),
867869
"X86_64SysV" => Ok(Conv::X86_64SysV),
868870
"X86_64Win64" => Ok(Conv::X86_64Win64),
871+
"GpuKernel" => Ok(Conv::GpuKernel),
869872
"AvrInterrupt" => Ok(Conv::AvrInterrupt),
870873
"AvrNonBlockingInterrupt" => Ok(Conv::AvrNonBlockingInterrupt),
871874
"RiscvInterrupt(machine)" => {

‎compiler/rustc_target/src/json.rs

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl ToJson for crate::abi::call::Conv {
113113
Self::X86VectorCall => "X86VectorCall",
114114
Self::X86_64SysV => "X86_64SysV",
115115
Self::X86_64Win64 => "X86_64Win64",
116+
Self::GpuKernel => "GpuKernel",
116117
Self::AvrInterrupt => "AvrInterrupt",
117118
Self::AvrNonBlockingInterrupt => "AvrNonBlockingInterrupt",
118119
Self::RiscvInterrupt { kind } => {

‎compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2854,6 +2854,7 @@ impl Target {
28542854
}
28552855
Win64 { .. } | SysV64 { .. } => self.arch == "x86_64",
28562856
PtxKernel => self.arch == "nvptx64",
2857+
GpuKernel => ["amdgpu", "nvptx64"].contains(&&self.arch[..]),
28572858
Msp430Interrupt => self.arch == "msp430",
28582859
RiscvInterruptM | RiscvInterruptS => ["riscv32", "riscv64"].contains(&&self.arch[..]),
28592860
AvrInterrupt | AvrNonBlockingInterrupt => self.arch == "avr",

‎compiler/rustc_ty_utils/src/abi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv
293293
PtxKernel => Conv::PtxKernel,
294294
Msp430Interrupt => Conv::Msp430Intr,
295295
X86Interrupt => Conv::X86Intr,
296+
GpuKernel => Conv::GpuKernel,
296297
AvrInterrupt => Conv::AvrInterrupt,
297298
AvrNonBlockingInterrupt => Conv::AvrNonBlockingInterrupt,
298299
RiscvInterruptM => Conv::RiscvInterrupt { kind: RiscvInterruptKind::Machine },

‎compiler/stable_mir/src/abi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ pub enum CallConvention {
442442

443443
PtxKernel,
444444

445+
GpuKernel,
446+
445447
X86Fastcall,
446448
X86Intr,
447449
X86Stdcall,

‎compiler/stable_mir/src/ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ pub enum Abi {
10771077
PtxKernel,
10781078
Msp430Interrupt,
10791079
X86Interrupt,
1080+
GpuKernel,
10801081
EfiApi,
10811082
AvrInterrupt,
10821083
AvrNonBlockingInterrupt,

‎tests/codegen/gpu-kernel-abi.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Checks that the gpu-kernel calling convention correctly translates to LLVM calling conventions.
2+
3+
//@ revisions: nvptx
4+
//@ [nvptx] compile-flags: --crate-type=rlib --target=nvptx64-nvidia-cuda
5+
//@ [nvptx] needs-llvm-components: nvptx
6+
#![feature(no_core, lang_items, abi_gpu_kernel)]
7+
#![no_core]
8+
9+
#[lang = "sized"]
10+
trait Sized {}
11+
#[lang = "freeze"]
12+
trait Freeze {}
13+
#[lang = "copy"]
14+
trait Copy {}
15+
16+
// nvptx: define ptx_kernel void @fun(i32
17+
#[no_mangle]
18+
pub extern "gpu-kernel" fn fun(_: i32) {}
+35-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "aapcs" is not supported on this target
18-
--> $DIR/unsupported.rs:49:17
18+
--> $DIR/unsupported.rs:52:17
1919
|
2020
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"aapcs"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:62:1
27+
--> $DIR/unsupported.rs:65:1
2828
|
2929
LL | extern "aapcs" {}
3030
| ^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "msp430-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:71:18
33+
--> $DIR/unsupported.rs:74:18
3434
|
3535
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:76:1
42+
--> $DIR/unsupported.rs:79:1
4343
|
4444
LL | extern "msp430-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "avr-interrupt" is not supported on this target
48-
--> $DIR/unsupported.rs:81:15
48+
--> $DIR/unsupported.rs:84:15
4949
|
5050
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:86:1
57+
--> $DIR/unsupported.rs:89:1
5858
|
5959
LL | extern "avr-interrupt" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "riscv-interrupt-m" is not supported on this target
63-
--> $DIR/unsupported.rs:94:17
63+
--> $DIR/unsupported.rs:97:17
6464
|
6565
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:105:1
72+
--> $DIR/unsupported.rs:108:1
7373
|
7474
LL | extern "riscv-interrupt-m" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "x86-interrupt" is not supported on this target
78-
--> $DIR/unsupported.rs:116:15
78+
--> $DIR/unsupported.rs:119:15
7979
|
8080
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
87-
--> $DIR/unsupported.rs:127:1
87+
--> $DIR/unsupported.rs:130:1
8888
|
8989
LL | extern "x86-interrupt" {}
9090
| ^^^^^^^^^^^^^^^^^^^^^^^^^
9191

9292
warning: the calling convention "thiscall" is not supported on this target
93-
--> $DIR/unsupported.rs:139:20
93+
--> $DIR/unsupported.rs:142:20
9494
|
9595
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
9696
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
9999
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
100100

101101
error[E0570]: `"thiscall"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:152:1
102+
--> $DIR/unsupported.rs:155:1
103103
|
104104
LL | extern "thiscall" {}
105105
| ^^^^^^^^^^^^^^^^^^^^
106106

107107
warning: the calling convention "stdcall" is not supported on this target
108-
--> $DIR/unsupported.rs:165:19
108+
--> $DIR/unsupported.rs:168:19
109109
|
110110
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
111111
| ^^^^^^^^^^^^^^^^^^^^^
@@ -114,13 +114,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
114114
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
115115

116116
error[E0570]: `"stdcall"` is not a supported ABI for the current target
117-
--> $DIR/unsupported.rs:178:1
117+
--> $DIR/unsupported.rs:181:1
118118
|
119119
LL | extern "stdcall" {}
120120
| ^^^^^^^^^^^^^^^^^^^
121121

122122
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
123-
--> $DIR/unsupported.rs:185:21
123+
--> $DIR/unsupported.rs:188:21
124124
|
125125
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
126126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -129,7 +129,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
129129
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
130130

131131
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
132-
--> $DIR/unsupported.rs:193:22
132+
--> $DIR/unsupported.rs:196:22
133133
|
134134
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -138,65 +138,71 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
138138
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
139139

140140
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
141-
--> $DIR/unsupported.rs:198:1
141+
--> $DIR/unsupported.rs:201:1
142142
|
143143
LL | extern "C-cmse-nonsecure-entry" {}
144144
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145145

146146
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
147-
--> $DIR/unsupported.rs:33:1
147+
--> $DIR/unsupported.rs:34:1
148148
|
149149
LL | extern "ptx-kernel" fn ptx() {}
150150
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151151

152-
error[E0570]: `"aapcs"` is not a supported ABI for the current target
152+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
153153
--> $DIR/unsupported.rs:43:1
154154
|
155+
LL | extern "gpu-kernel" fn gpu() {}
156+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157+
158+
error[E0570]: `"aapcs"` is not a supported ABI for the current target
159+
--> $DIR/unsupported.rs:46:1
160+
|
155161
LL | extern "aapcs" fn aapcs() {}
156162
| ^^^^^^^^^^^^^^^^^^^^^^^^^
157163

158164
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
159-
--> $DIR/unsupported.rs:69:1
165+
--> $DIR/unsupported.rs:72:1
160166
|
161167
LL | extern "msp430-interrupt" fn msp430() {}
162168
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163169

164170
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
165-
--> $DIR/unsupported.rs:79:1
171+
--> $DIR/unsupported.rs:82:1
166172
|
167173
LL | extern "avr-interrupt" fn avr() {}
168174
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169175

170176
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
171-
--> $DIR/unsupported.rs:89:1
177+
--> $DIR/unsupported.rs:92:1
172178
|
173179
LL | extern "riscv-interrupt-m" fn riscv() {}
174180
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175181

176182
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
177-
--> $DIR/unsupported.rs:111:1
183+
--> $DIR/unsupported.rs:114:1
178184
|
179185
LL | extern "x86-interrupt" fn x86() {}
180186
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
181187

182188
error[E0570]: `"thiscall"` is not a supported ABI for the current target
183-
--> $DIR/unsupported.rs:133:1
189+
--> $DIR/unsupported.rs:136:1
184190
|
185191
LL | extern "thiscall" fn thiscall() {}
186192
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187193

188194
error[E0570]: `"stdcall"` is not a supported ABI for the current target
189-
--> $DIR/unsupported.rs:159:1
195+
--> $DIR/unsupported.rs:162:1
190196
|
191197
LL | extern "stdcall" fn stdcall() {}
192198
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193199

194200
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
195-
--> $DIR/unsupported.rs:191:1
201+
--> $DIR/unsupported.rs:194:1
196202
|
197203
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
198204
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
199205

200-
error: aborting due to 18 previous errors; 10 warnings emitted
206+
error: aborting due to 19 previous errors; 10 warnings emitted
201207

202208
For more information about this error, try `rustc --explain E0570`.

‎tests/ui/abi/unsupported.arm.stderr

+32-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "msp430-interrupt" is not supported on this target
18-
--> $DIR/unsupported.rs:71:18
18+
--> $DIR/unsupported.rs:74:18
1919
|
2020
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:76:1
27+
--> $DIR/unsupported.rs:79:1
2828
|
2929
LL | extern "msp430-interrupt" {}
3030
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "avr-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:81:15
33+
--> $DIR/unsupported.rs:84:15
3434
|
3535
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:86:1
42+
--> $DIR/unsupported.rs:89:1
4343
|
4444
LL | extern "avr-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "riscv-interrupt-m" is not supported on this target
48-
--> $DIR/unsupported.rs:94:17
48+
--> $DIR/unsupported.rs:97:17
4949
|
5050
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:105:1
57+
--> $DIR/unsupported.rs:108:1
5858
|
5959
LL | extern "riscv-interrupt-m" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "x86-interrupt" is not supported on this target
63-
--> $DIR/unsupported.rs:116:15
63+
--> $DIR/unsupported.rs:119:15
6464
|
6565
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:127:1
72+
--> $DIR/unsupported.rs:130:1
7373
|
7474
LL | extern "x86-interrupt" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "thiscall" is not supported on this target
78-
--> $DIR/unsupported.rs:139:20
78+
--> $DIR/unsupported.rs:142:20
7979
|
8080
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
error[E0570]: `"thiscall"` is not a supported ABI for the current target
87-
--> $DIR/unsupported.rs:152:1
87+
--> $DIR/unsupported.rs:155:1
8888
|
8989
LL | extern "thiscall" {}
9090
| ^^^^^^^^^^^^^^^^^^^^
9191

9292
warning: the calling convention "stdcall" is not supported on this target
93-
--> $DIR/unsupported.rs:165:19
93+
--> $DIR/unsupported.rs:168:19
9494
|
9595
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9696
| ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9999
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
100100

101101
error[E0570]: `"stdcall"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:178:1
102+
--> $DIR/unsupported.rs:181:1
103103
|
104104
LL | extern "stdcall" {}
105105
| ^^^^^^^^^^^^^^^^^^^
106106

107107
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
108-
--> $DIR/unsupported.rs:185:21
108+
--> $DIR/unsupported.rs:188:21
109109
|
110110
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
114114
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
115115

116116
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
117-
--> $DIR/unsupported.rs:193:22
117+
--> $DIR/unsupported.rs:196:22
118118
|
119119
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
123123
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
124124

125125
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
126-
--> $DIR/unsupported.rs:198:1
126+
--> $DIR/unsupported.rs:201:1
127127
|
128128
LL | extern "C-cmse-nonsecure-entry" {}
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130

131131
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
132-
--> $DIR/unsupported.rs:33:1
132+
--> $DIR/unsupported.rs:34:1
133133
|
134134
LL | extern "ptx-kernel" fn ptx() {}
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136136

137+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
138+
--> $DIR/unsupported.rs:43:1
139+
|
140+
LL | extern "gpu-kernel" fn gpu() {}
141+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
137143
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
138-
--> $DIR/unsupported.rs:69:1
144+
--> $DIR/unsupported.rs:72:1
139145
|
140146
LL | extern "msp430-interrupt" fn msp430() {}
141147
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142148

143149
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
144-
--> $DIR/unsupported.rs:79:1
150+
--> $DIR/unsupported.rs:82:1
145151
|
146152
LL | extern "avr-interrupt" fn avr() {}
147153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148154

149155
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
150-
--> $DIR/unsupported.rs:89:1
156+
--> $DIR/unsupported.rs:92:1
151157
|
152158
LL | extern "riscv-interrupt-m" fn riscv() {}
153159
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154160

155161
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
156-
--> $DIR/unsupported.rs:111:1
162+
--> $DIR/unsupported.rs:114:1
157163
|
158164
LL | extern "x86-interrupt" fn x86() {}
159165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160166

161167
error[E0570]: `"thiscall"` is not a supported ABI for the current target
162-
--> $DIR/unsupported.rs:133:1
168+
--> $DIR/unsupported.rs:136:1
163169
|
164170
LL | extern "thiscall" fn thiscall() {}
165171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166172

167173
error[E0570]: `"stdcall"` is not a supported ABI for the current target
168-
--> $DIR/unsupported.rs:159:1
174+
--> $DIR/unsupported.rs:162:1
169175
|
170176
LL | extern "stdcall" fn stdcall() {}
171177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172178

173179
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
174-
--> $DIR/unsupported.rs:191:1
180+
--> $DIR/unsupported.rs:194:1
175181
|
176182
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
177183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178184

179-
error: aborting due to 16 previous errors; 9 warnings emitted
185+
error: aborting due to 17 previous errors; 9 warnings emitted
180186

181187
For more information about this error, try `rustc --explain E0570`.

‎tests/ui/abi/unsupported.i686.stderr

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "aapcs" is not supported on this target
18-
--> $DIR/unsupported.rs:49:17
18+
--> $DIR/unsupported.rs:52:17
1919
|
2020
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"aapcs"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:62:1
27+
--> $DIR/unsupported.rs:65:1
2828
|
2929
LL | extern "aapcs" {}
3030
| ^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "msp430-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:71:18
33+
--> $DIR/unsupported.rs:74:18
3434
|
3535
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:76:1
42+
--> $DIR/unsupported.rs:79:1
4343
|
4444
LL | extern "msp430-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "avr-interrupt" is not supported on this target
48-
--> $DIR/unsupported.rs:81:15
48+
--> $DIR/unsupported.rs:84:15
4949
|
5050
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:86:1
57+
--> $DIR/unsupported.rs:89:1
5858
|
5959
LL | extern "avr-interrupt" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "riscv-interrupt-m" is not supported on this target
63-
--> $DIR/unsupported.rs:94:17
63+
--> $DIR/unsupported.rs:97:17
6464
|
6565
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:105:1
72+
--> $DIR/unsupported.rs:108:1
7373
|
7474
LL | extern "riscv-interrupt-m" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
78-
--> $DIR/unsupported.rs:185:21
78+
--> $DIR/unsupported.rs:188:21
7979
|
8080
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,7 +84,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
87-
--> $DIR/unsupported.rs:193:22
87+
--> $DIR/unsupported.rs:196:22
8888
|
8989
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
9090
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -93,47 +93,53 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
9393
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
9494

9595
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
96-
--> $DIR/unsupported.rs:198:1
96+
--> $DIR/unsupported.rs:201:1
9797
|
9898
LL | extern "C-cmse-nonsecure-entry" {}
9999
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100100

101101
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:33:1
102+
--> $DIR/unsupported.rs:34:1
103103
|
104104
LL | extern "ptx-kernel" fn ptx() {}
105105
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106106

107-
error[E0570]: `"aapcs"` is not a supported ABI for the current target
107+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
108108
--> $DIR/unsupported.rs:43:1
109109
|
110+
LL | extern "gpu-kernel" fn gpu() {}
111+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112+
113+
error[E0570]: `"aapcs"` is not a supported ABI for the current target
114+
--> $DIR/unsupported.rs:46:1
115+
|
110116
LL | extern "aapcs" fn aapcs() {}
111117
| ^^^^^^^^^^^^^^^^^^^^^^^^^
112118

113119
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
114-
--> $DIR/unsupported.rs:69:1
120+
--> $DIR/unsupported.rs:72:1
115121
|
116122
LL | extern "msp430-interrupt" fn msp430() {}
117123
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118124

119125
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
120-
--> $DIR/unsupported.rs:79:1
126+
--> $DIR/unsupported.rs:82:1
121127
|
122128
LL | extern "avr-interrupt" fn avr() {}
123129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124130

125131
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
126-
--> $DIR/unsupported.rs:89:1
132+
--> $DIR/unsupported.rs:92:1
127133
|
128134
LL | extern "riscv-interrupt-m" fn riscv() {}
129135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130136

131137
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
132-
--> $DIR/unsupported.rs:191:1
138+
--> $DIR/unsupported.rs:194:1
133139
|
134140
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
135141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136142

137-
error: aborting due to 12 previous errors; 7 warnings emitted
143+
error: aborting due to 13 previous errors; 7 warnings emitted
138144

139145
For more information about this error, try `rustc --explain E0570`.
+32-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "aapcs" is not supported on this target
18-
--> $DIR/unsupported.rs:49:17
18+
--> $DIR/unsupported.rs:52:17
1919
|
2020
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"aapcs"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:62:1
27+
--> $DIR/unsupported.rs:65:1
2828
|
2929
LL | extern "aapcs" {}
3030
| ^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "msp430-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:71:18
33+
--> $DIR/unsupported.rs:74:18
3434
|
3535
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:76:1
42+
--> $DIR/unsupported.rs:79:1
4343
|
4444
LL | extern "msp430-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "avr-interrupt" is not supported on this target
48-
--> $DIR/unsupported.rs:81:15
48+
--> $DIR/unsupported.rs:84:15
4949
|
5050
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:86:1
57+
--> $DIR/unsupported.rs:89:1
5858
|
5959
LL | extern "avr-interrupt" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "x86-interrupt" is not supported on this target
63-
--> $DIR/unsupported.rs:116:15
63+
--> $DIR/unsupported.rs:119:15
6464
|
6565
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:127:1
72+
--> $DIR/unsupported.rs:130:1
7373
|
7474
LL | extern "x86-interrupt" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "thiscall" is not supported on this target
78-
--> $DIR/unsupported.rs:139:20
78+
--> $DIR/unsupported.rs:142:20
7979
|
8080
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
error[E0570]: `"thiscall"` is not a supported ABI for the current target
87-
--> $DIR/unsupported.rs:152:1
87+
--> $DIR/unsupported.rs:155:1
8888
|
8989
LL | extern "thiscall" {}
9090
| ^^^^^^^^^^^^^^^^^^^^
9191

9292
warning: the calling convention "stdcall" is not supported on this target
93-
--> $DIR/unsupported.rs:165:19
93+
--> $DIR/unsupported.rs:168:19
9494
|
9595
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9696
| ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9999
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
100100

101101
error[E0570]: `"stdcall"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:178:1
102+
--> $DIR/unsupported.rs:181:1
103103
|
104104
LL | extern "stdcall" {}
105105
| ^^^^^^^^^^^^^^^^^^^
106106

107107
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
108-
--> $DIR/unsupported.rs:185:21
108+
--> $DIR/unsupported.rs:188:21
109109
|
110110
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
114114
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
115115

116116
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
117-
--> $DIR/unsupported.rs:193:22
117+
--> $DIR/unsupported.rs:196:22
118118
|
119119
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
123123
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
124124

125125
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
126-
--> $DIR/unsupported.rs:198:1
126+
--> $DIR/unsupported.rs:201:1
127127
|
128128
LL | extern "C-cmse-nonsecure-entry" {}
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130

131131
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
132-
--> $DIR/unsupported.rs:33:1
132+
--> $DIR/unsupported.rs:34:1
133133
|
134134
LL | extern "ptx-kernel" fn ptx() {}
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136136

137-
error[E0570]: `"aapcs"` is not a supported ABI for the current target
137+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
138138
--> $DIR/unsupported.rs:43:1
139139
|
140+
LL | extern "gpu-kernel" fn gpu() {}
141+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
143+
error[E0570]: `"aapcs"` is not a supported ABI for the current target
144+
--> $DIR/unsupported.rs:46:1
145+
|
140146
LL | extern "aapcs" fn aapcs() {}
141147
| ^^^^^^^^^^^^^^^^^^^^^^^^^
142148

143149
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
144-
--> $DIR/unsupported.rs:69:1
150+
--> $DIR/unsupported.rs:72:1
145151
|
146152
LL | extern "msp430-interrupt" fn msp430() {}
147153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148154

149155
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
150-
--> $DIR/unsupported.rs:79:1
156+
--> $DIR/unsupported.rs:82:1
151157
|
152158
LL | extern "avr-interrupt" fn avr() {}
153159
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154160

155161
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
156-
--> $DIR/unsupported.rs:111:1
162+
--> $DIR/unsupported.rs:114:1
157163
|
158164
LL | extern "x86-interrupt" fn x86() {}
159165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160166

161167
error[E0570]: `"thiscall"` is not a supported ABI for the current target
162-
--> $DIR/unsupported.rs:133:1
168+
--> $DIR/unsupported.rs:136:1
163169
|
164170
LL | extern "thiscall" fn thiscall() {}
165171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166172

167173
error[E0570]: `"stdcall"` is not a supported ABI for the current target
168-
--> $DIR/unsupported.rs:159:1
174+
--> $DIR/unsupported.rs:162:1
169175
|
170176
LL | extern "stdcall" fn stdcall() {}
171177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172178

173179
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
174-
--> $DIR/unsupported.rs:191:1
180+
--> $DIR/unsupported.rs:194:1
175181
|
176182
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
177183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178184

179-
error: aborting due to 16 previous errors; 9 warnings emitted
185+
error: aborting due to 17 previous errors; 9 warnings emitted
180186

181187
For more information about this error, try `rustc --explain E0570`.
+32-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "aapcs" is not supported on this target
18-
--> $DIR/unsupported.rs:49:17
18+
--> $DIR/unsupported.rs:52:17
1919
|
2020
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"aapcs"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:62:1
27+
--> $DIR/unsupported.rs:65:1
2828
|
2929
LL | extern "aapcs" {}
3030
| ^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "msp430-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:71:18
33+
--> $DIR/unsupported.rs:74:18
3434
|
3535
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:76:1
42+
--> $DIR/unsupported.rs:79:1
4343
|
4444
LL | extern "msp430-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "avr-interrupt" is not supported on this target
48-
--> $DIR/unsupported.rs:81:15
48+
--> $DIR/unsupported.rs:84:15
4949
|
5050
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:86:1
57+
--> $DIR/unsupported.rs:89:1
5858
|
5959
LL | extern "avr-interrupt" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "x86-interrupt" is not supported on this target
63-
--> $DIR/unsupported.rs:116:15
63+
--> $DIR/unsupported.rs:119:15
6464
|
6565
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:127:1
72+
--> $DIR/unsupported.rs:130:1
7373
|
7474
LL | extern "x86-interrupt" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "thiscall" is not supported on this target
78-
--> $DIR/unsupported.rs:139:20
78+
--> $DIR/unsupported.rs:142:20
7979
|
8080
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
error[E0570]: `"thiscall"` is not a supported ABI for the current target
87-
--> $DIR/unsupported.rs:152:1
87+
--> $DIR/unsupported.rs:155:1
8888
|
8989
LL | extern "thiscall" {}
9090
| ^^^^^^^^^^^^^^^^^^^^
9191

9292
warning: the calling convention "stdcall" is not supported on this target
93-
--> $DIR/unsupported.rs:165:19
93+
--> $DIR/unsupported.rs:168:19
9494
|
9595
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9696
| ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9999
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
100100

101101
error[E0570]: `"stdcall"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:178:1
102+
--> $DIR/unsupported.rs:181:1
103103
|
104104
LL | extern "stdcall" {}
105105
| ^^^^^^^^^^^^^^^^^^^
106106

107107
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
108-
--> $DIR/unsupported.rs:185:21
108+
--> $DIR/unsupported.rs:188:21
109109
|
110110
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
114114
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
115115

116116
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
117-
--> $DIR/unsupported.rs:193:22
117+
--> $DIR/unsupported.rs:196:22
118118
|
119119
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
123123
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
124124

125125
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
126-
--> $DIR/unsupported.rs:198:1
126+
--> $DIR/unsupported.rs:201:1
127127
|
128128
LL | extern "C-cmse-nonsecure-entry" {}
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130

131131
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
132-
--> $DIR/unsupported.rs:33:1
132+
--> $DIR/unsupported.rs:34:1
133133
|
134134
LL | extern "ptx-kernel" fn ptx() {}
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136136

137-
error[E0570]: `"aapcs"` is not a supported ABI for the current target
137+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
138138
--> $DIR/unsupported.rs:43:1
139139
|
140+
LL | extern "gpu-kernel" fn gpu() {}
141+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
143+
error[E0570]: `"aapcs"` is not a supported ABI for the current target
144+
--> $DIR/unsupported.rs:46:1
145+
|
140146
LL | extern "aapcs" fn aapcs() {}
141147
| ^^^^^^^^^^^^^^^^^^^^^^^^^
142148

143149
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
144-
--> $DIR/unsupported.rs:69:1
150+
--> $DIR/unsupported.rs:72:1
145151
|
146152
LL | extern "msp430-interrupt" fn msp430() {}
147153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148154

149155
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
150-
--> $DIR/unsupported.rs:79:1
156+
--> $DIR/unsupported.rs:82:1
151157
|
152158
LL | extern "avr-interrupt" fn avr() {}
153159
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154160

155161
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
156-
--> $DIR/unsupported.rs:111:1
162+
--> $DIR/unsupported.rs:114:1
157163
|
158164
LL | extern "x86-interrupt" fn x86() {}
159165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160166

161167
error[E0570]: `"thiscall"` is not a supported ABI for the current target
162-
--> $DIR/unsupported.rs:133:1
168+
--> $DIR/unsupported.rs:136:1
163169
|
164170
LL | extern "thiscall" fn thiscall() {}
165171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166172

167173
error[E0570]: `"stdcall"` is not a supported ABI for the current target
168-
--> $DIR/unsupported.rs:159:1
174+
--> $DIR/unsupported.rs:162:1
169175
|
170176
LL | extern "stdcall" fn stdcall() {}
171177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172178

173179
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
174-
--> $DIR/unsupported.rs:191:1
180+
--> $DIR/unsupported.rs:194:1
175181
|
176182
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
177183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178184

179-
error: aborting due to 16 previous errors; 9 warnings emitted
185+
error: aborting due to 17 previous errors; 9 warnings emitted
180186

181187
For more information about this error, try `rustc --explain E0570`.

‎tests/ui/abi/unsupported.rs

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
abi_ptx,
2020
abi_msp430_interrupt,
2121
abi_avr_interrupt,
22+
abi_gpu_kernel,
2223
abi_x86_interrupt,
2324
abi_riscv_interrupt,
2425
abi_c_cmse_nonsecure_call,
@@ -39,6 +40,8 @@ fn ptx_ptr(f: extern "ptx-kernel" fn()) {
3940
}
4041
extern "ptx-kernel" {}
4142
//~^ ERROR is not a supported ABI
43+
extern "gpu-kernel" fn gpu() {}
44+
//~^ ERROR is not a supported ABI
4245

4346
extern "aapcs" fn aapcs() {}
4447
//[x64]~^ ERROR is not a supported ABI

‎tests/ui/abi/unsupported.x64.stderr

+32-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the calling convention "ptx-kernel" is not supported on this target
2-
--> $DIR/unsupported.rs:35:15
2+
--> $DIR/unsupported.rs:36:15
33
|
44
LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
99
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
1010

1111
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
12-
--> $DIR/unsupported.rs:40:1
12+
--> $DIR/unsupported.rs:41:1
1313
|
1414
LL | extern "ptx-kernel" {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^
1616

1717
warning: the calling convention "aapcs" is not supported on this target
18-
--> $DIR/unsupported.rs:49:17
18+
--> $DIR/unsupported.rs:52:17
1919
|
2020
LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2121
| ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
2424
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
2525

2626
error[E0570]: `"aapcs"` is not a supported ABI for the current target
27-
--> $DIR/unsupported.rs:62:1
27+
--> $DIR/unsupported.rs:65:1
2828
|
2929
LL | extern "aapcs" {}
3030
| ^^^^^^^^^^^^^^^^^
3131

3232
warning: the calling convention "msp430-interrupt" is not supported on this target
33-
--> $DIR/unsupported.rs:71:18
33+
--> $DIR/unsupported.rs:74:18
3434
|
3535
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
3939
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
4040

4141
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
42-
--> $DIR/unsupported.rs:76:1
42+
--> $DIR/unsupported.rs:79:1
4343
|
4444
LL | extern "msp430-interrupt" {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646

4747
warning: the calling convention "avr-interrupt" is not supported on this target
48-
--> $DIR/unsupported.rs:81:15
48+
--> $DIR/unsupported.rs:84:15
4949
|
5050
LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
5454
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
5555

5656
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
57-
--> $DIR/unsupported.rs:86:1
57+
--> $DIR/unsupported.rs:89:1
5858
|
5959
LL | extern "avr-interrupt" {}
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6161

6262
warning: the calling convention "riscv-interrupt-m" is not supported on this target
63-
--> $DIR/unsupported.rs:94:17
63+
--> $DIR/unsupported.rs:97:17
6464
|
6565
LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
6969
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
7070

7171
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
72-
--> $DIR/unsupported.rs:105:1
72+
--> $DIR/unsupported.rs:108:1
7373
|
7474
LL | extern "riscv-interrupt-m" {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
warning: the calling convention "thiscall" is not supported on this target
78-
--> $DIR/unsupported.rs:139:20
78+
--> $DIR/unsupported.rs:142:20
7979
|
8080
LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8181
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
8484
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
8585

8686
error[E0570]: `"thiscall"` is not a supported ABI for the current target
87-
--> $DIR/unsupported.rs:152:1
87+
--> $DIR/unsupported.rs:155:1
8888
|
8989
LL | extern "thiscall" {}
9090
| ^^^^^^^^^^^^^^^^^^^^
9191

9292
warning: the calling convention "stdcall" is not supported on this target
93-
--> $DIR/unsupported.rs:165:19
93+
--> $DIR/unsupported.rs:168:19
9494
|
9595
LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9696
| ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
9999
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
100100

101101
error[E0570]: `"stdcall"` is not a supported ABI for the current target
102-
--> $DIR/unsupported.rs:178:1
102+
--> $DIR/unsupported.rs:181:1
103103
|
104104
LL | extern "stdcall" {}
105105
| ^^^^^^^^^^^^^^^^^^^
106106

107107
warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
108-
--> $DIR/unsupported.rs:185:21
108+
--> $DIR/unsupported.rs:188:21
109109
|
110110
LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
114114
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
115115

116116
warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
117-
--> $DIR/unsupported.rs:193:22
117+
--> $DIR/unsupported.rs:196:22
118118
|
119119
LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
123123
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
124124

125125
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
126-
--> $DIR/unsupported.rs:198:1
126+
--> $DIR/unsupported.rs:201:1
127127
|
128128
LL | extern "C-cmse-nonsecure-entry" {}
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130

131131
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
132-
--> $DIR/unsupported.rs:33:1
132+
--> $DIR/unsupported.rs:34:1
133133
|
134134
LL | extern "ptx-kernel" fn ptx() {}
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136136

137-
error[E0570]: `"aapcs"` is not a supported ABI for the current target
137+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
138138
--> $DIR/unsupported.rs:43:1
139139
|
140+
LL | extern "gpu-kernel" fn gpu() {}
141+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
143+
error[E0570]: `"aapcs"` is not a supported ABI for the current target
144+
--> $DIR/unsupported.rs:46:1
145+
|
140146
LL | extern "aapcs" fn aapcs() {}
141147
| ^^^^^^^^^^^^^^^^^^^^^^^^^
142148

143149
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
144-
--> $DIR/unsupported.rs:69:1
150+
--> $DIR/unsupported.rs:72:1
145151
|
146152
LL | extern "msp430-interrupt" fn msp430() {}
147153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148154

149155
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
150-
--> $DIR/unsupported.rs:79:1
156+
--> $DIR/unsupported.rs:82:1
151157
|
152158
LL | extern "avr-interrupt" fn avr() {}
153159
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154160

155161
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
156-
--> $DIR/unsupported.rs:89:1
162+
--> $DIR/unsupported.rs:92:1
157163
|
158164
LL | extern "riscv-interrupt-m" fn riscv() {}
159165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160166

161167
error[E0570]: `"thiscall"` is not a supported ABI for the current target
162-
--> $DIR/unsupported.rs:133:1
168+
--> $DIR/unsupported.rs:136:1
163169
|
164170
LL | extern "thiscall" fn thiscall() {}
165171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166172

167173
error[E0570]: `"stdcall"` is not a supported ABI for the current target
168-
--> $DIR/unsupported.rs:159:1
174+
--> $DIR/unsupported.rs:162:1
169175
|
170176
LL | extern "stdcall" fn stdcall() {}
171177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172178

173179
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
174-
--> $DIR/unsupported.rs:191:1
180+
--> $DIR/unsupported.rs:194:1
175181
|
176182
LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
177183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178184

179-
error: aborting due to 16 previous errors; 9 warnings emitted
185+
error: aborting due to 17 previous errors; 9 warnings emitted
180186

181187
For more information about this error, try `rustc --explain E0570`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//@ compile-flags: --crate-type=rlib
2+
3+
#![feature(no_core, lang_items)]
4+
#![no_core]
5+
6+
#[lang="sized"]
7+
trait Sized { }
8+
9+
#[lang="tuple_trait"]
10+
trait Tuple { }
11+
12+
// Functions
13+
extern "gpu-kernel" fn f1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change
14+
//~^ ERROR is not a supported ABI
15+
16+
// Methods in trait definition
17+
trait Tr {
18+
extern "gpu-kernel" fn m1(_: ()); //~ ERROR gpu-kernel ABI is experimental and subject to change
19+
20+
extern "gpu-kernel" fn dm1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change
21+
//~^ ERROR is not a supported ABI
22+
}
23+
24+
struct S;
25+
26+
// Methods in trait impl
27+
impl Tr for S {
28+
extern "gpu-kernel" fn m1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change
29+
//~^ ERROR is not a supported ABI
30+
}
31+
32+
// Methods in inherent impl
33+
impl S {
34+
extern "gpu-kernel" fn im1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change
35+
//~^ ERROR is not a supported ABI
36+
}
37+
38+
// Function pointer types
39+
type A1 = extern "gpu-kernel" fn(_: ()); //~ ERROR gpu-kernel ABI is experimental and subject to change
40+
//~^ WARN the calling convention "gpu-kernel" is not supported on this target
41+
//~^^ WARN this was previously accepted by the compiler but is being phased out
42+
43+
// Foreign modules
44+
extern "gpu-kernel" {} //~ ERROR gpu-kernel ABI is experimental and subject to change
45+
//~^ ERROR is not a supported ABI
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
error[E0658]: gpu-kernel ABI is experimental and subject to change
2+
--> $DIR/feature-gate-abi_gpu_kernel.rs:13:8
3+
|
4+
LL | extern "gpu-kernel" fn f1(_: ()) {}
5+
| ^^^^^^^^^^^^
6+
|
7+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
8+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error[E0658]: gpu-kernel ABI is experimental and subject to change
12+
--> $DIR/feature-gate-abi_gpu_kernel.rs:18:12
13+
|
14+
LL | extern "gpu-kernel" fn m1(_: ());
15+
| ^^^^^^^^^^^^
16+
|
17+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
18+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+
error[E0658]: gpu-kernel ABI is experimental and subject to change
22+
--> $DIR/feature-gate-abi_gpu_kernel.rs:20:12
23+
|
24+
LL | extern "gpu-kernel" fn dm1(_: ()) {}
25+
| ^^^^^^^^^^^^
26+
|
27+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
28+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
29+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
30+
31+
error[E0658]: gpu-kernel ABI is experimental and subject to change
32+
--> $DIR/feature-gate-abi_gpu_kernel.rs:28:12
33+
|
34+
LL | extern "gpu-kernel" fn m1(_: ()) {}
35+
| ^^^^^^^^^^^^
36+
|
37+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
38+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
39+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
40+
41+
error[E0658]: gpu-kernel ABI is experimental and subject to change
42+
--> $DIR/feature-gate-abi_gpu_kernel.rs:34:12
43+
|
44+
LL | extern "gpu-kernel" fn im1(_: ()) {}
45+
| ^^^^^^^^^^^^
46+
|
47+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
48+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: gpu-kernel ABI is experimental and subject to change
52+
--> $DIR/feature-gate-abi_gpu_kernel.rs:39:18
53+
|
54+
LL | type A1 = extern "gpu-kernel" fn(_: ());
55+
| ^^^^^^^^^^^^
56+
|
57+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
58+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error[E0658]: gpu-kernel ABI is experimental and subject to change
62+
--> $DIR/feature-gate-abi_gpu_kernel.rs:44:8
63+
|
64+
LL | extern "gpu-kernel" {}
65+
| ^^^^^^^^^^^^
66+
|
67+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
68+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
69+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
70+
71+
warning: the calling convention "gpu-kernel" is not supported on this target
72+
--> $DIR/feature-gate-abi_gpu_kernel.rs:39:11
73+
|
74+
LL | type A1 = extern "gpu-kernel" fn(_: ());
75+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
|
77+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
78+
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
79+
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
80+
81+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
82+
--> $DIR/feature-gate-abi_gpu_kernel.rs:44:1
83+
|
84+
LL | extern "gpu-kernel" {}
85+
| ^^^^^^^^^^^^^^^^^^^^^^
86+
87+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
88+
--> $DIR/feature-gate-abi_gpu_kernel.rs:13:1
89+
|
90+
LL | extern "gpu-kernel" fn f1(_: ()) {}
91+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92+
93+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
94+
--> $DIR/feature-gate-abi_gpu_kernel.rs:20:5
95+
|
96+
LL | extern "gpu-kernel" fn dm1(_: ()) {}
97+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+
99+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
100+
--> $DIR/feature-gate-abi_gpu_kernel.rs:28:5
101+
|
102+
LL | extern "gpu-kernel" fn m1(_: ()) {}
103+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104+
105+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
106+
--> $DIR/feature-gate-abi_gpu_kernel.rs:34:5
107+
|
108+
LL | extern "gpu-kernel" fn im1(_: ()) {}
109+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110+
111+
error: aborting due to 12 previous errors; 1 warning emitted
112+
113+
Some errors have detailed explanations: E0570, E0658.
114+
For more information about an error, try `rustc --explain E0570`.

‎tests/ui/print-calling-conventions.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cdecl-unwind
1212
efiapi
1313
fastcall
1414
fastcall-unwind
15+
gpu-kernel
1516
msp430-interrupt
1617
ptx-kernel
1718
riscv-interrupt-m

0 commit comments

Comments
 (0)
Please sign in to comment.