@@ -2541,14 +2541,15 @@ where
2541
2541
} ;
2542
2542
2543
2543
let target = & cx. tcx ( ) . sess . target . target ;
2544
+ let target_env_gnu_like = matches ! ( & target. target_env[ ..] , "gnu" | "musl" ) ;
2544
2545
let win_x64_gnu =
2545
2546
target. target_os == "windows" && target. arch == "x86_64" && target. target_env == "gnu" ;
2546
- let linux_s390x =
2547
- target. target_os == "linux" && target. arch == "s390x" && target . target_env == "gnu" ;
2548
- let linux_sparc64 =
2549
- target. target_os == "linux" && target. arch == "sparc64" && target . target_env == "gnu" ;
2550
- let linux_powerpc =
2551
- target. target_os == "linux" && target. arch == "powerpc" && target . target_env == "gnu" ;
2547
+ let linux_s390x_gnu_like =
2548
+ target. target_os == "linux" && target. arch == "s390x" && target_env_gnu_like ;
2549
+ let linux_sparc64_gnu_like =
2550
+ target. target_os == "linux" && target. arch == "sparc64" && target_env_gnu_like ;
2551
+ let linux_powerpc_gnu_like =
2552
+ target. target_os == "linux" && target. arch == "powerpc" && target_env_gnu_like ;
2552
2553
let rust_abi = match sig. abi {
2553
2554
RustIntrinsic | PlatformIntrinsic | Rust | RustCall => true ,
2554
2555
_ => false ,
@@ -2619,11 +2620,13 @@ where
2619
2620
if arg. layout . is_zst ( ) {
2620
2621
// For some forsaken reason, x86_64-pc-windows-gnu
2621
2622
// doesn't ignore zero-sized struct arguments.
2622
- // The same is true for s390x-unknown-linux-gnu,
2623
- // sparc64-unknown-linux-gnu and powerpc-unknown-linux-gnu.
2623
+ // The same is true for {s390x,sparc64,powerpc}-unknown-linux-{gnu,musl}.
2624
2624
if is_return
2625
2625
|| rust_abi
2626
- || ( !win_x64_gnu && !linux_s390x && !linux_sparc64 && !linux_powerpc)
2626
+ || ( !win_x64_gnu
2627
+ && !linux_s390x_gnu_like
2628
+ && !linux_sparc64_gnu_like
2629
+ && !linux_powerpc_gnu_like)
2627
2630
{
2628
2631
arg. mode = PassMode :: Ignore ;
2629
2632
}
0 commit comments