Skip to content

Commit 13678f8

Browse files
committed
abi: replace extern "C" with extern "unadjusted", not Rust ABI.
1 parent f833312 commit 13678f8

File tree

1 file changed

+2
-2
lines changed
  • crates/rustc_codegen_spirv/src

1 file changed

+2
-2
lines changed

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ pub(crate) fn provide(providers: &mut Providers) {
3737
// This theoretically then should be fine to leave as C, but, there's no backend hook for
3838
// FnAbi::adjust_for_cabi, causing it to panic:
3939
// https://github.com/rust-lang/rust/blob/5fae56971d8487088c0099c82c0a5ce1638b5f62/compiler/rustc_target/src/abi/call/mod.rs#L603
40-
// So, treat any extern "C" functions as actually being Rust ABI, to be able to compile libcore with arch=spirv.
40+
// So, treat any `extern "C"` functions as `extern "unadjusted"`, to be able to compile libcore with arch=spirv.
4141
providers.fn_sig = |tcx, def_id| {
4242
// We can't capture the old fn_sig and just call that, because fn_sig is a `fn`, not a `Fn`, i.e. it can't
4343
// capture variables. Fortunately, the defaults are exposed (thanks rustdoc), so use that instead.
4444
let result = (rustc_interface::DEFAULT_QUERY_PROVIDERS.fn_sig)(tcx, def_id);
4545
result.map_bound(|mut inner| {
4646
if let SpecAbi::C { .. } = inner.abi {
47-
inner.abi = SpecAbi::Rust;
47+
inner.abi = SpecAbi::Unadjusted;
4848
}
4949
inner
5050
})

0 commit comments

Comments
 (0)