Skip to content

Commit 1d07a39

Browse files
compiler: use is_rustic_abi in ty_utils
expands some conditionals to include different "rustic" ABIs, so that we actually handle passing args through all "rustic" ABIs
1 parent e81fbe3 commit 1d07a39

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

compiler/rustc_ty_utils/src/abi.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,7 @@ fn fn_abi_sanity_check<'tcx>(
436436
) {
437437
let tcx = cx.tcx();
438438

439-
if spec_abi == ExternAbi::Rust
440-
|| spec_abi == ExternAbi::RustCall
441-
|| spec_abi == ExternAbi::RustCold
442-
{
439+
if spec_abi.is_rustic_abi() {
443440
if arg.layout.is_zst() {
444441
// Casting closures to function pointers depends on ZST closure types being
445442
// omitted entirely in the calling convention.
@@ -687,7 +684,7 @@ fn fn_abi_adjust_for_abi<'tcx>(
687684

688685
let tcx = cx.tcx();
689686

690-
if abi == ExternAbi::Rust || abi == ExternAbi::RustCall || abi == ExternAbi::RustIntrinsic {
687+
if abi.is_rustic_abi() {
691688
fn_abi.adjust_for_rust_abi(cx, abi);
692689

693690
// Look up the deduced parameter attributes for this function, if we have its def ID and

tests/crashes/132981.rs

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@compile-flags: -Clink-dead-code=true --crate-type lib
2+
// We used to not handle all "rustic" ABIs in a (relatively) uniform way,
3+
// so we failed to fix up arguments for actually passing through the ABI...
4+
#![feature(rust_cold_cc)]
5+
pub extern "rust-cold" fn foo(_: [usize; 3]) {}

0 commit comments

Comments
 (0)