@@ -2541,14 +2541,15 @@ where
25412541 } ;
25422542
25432543 let target = & cx. tcx ( ) . sess . target . target ;
2544+ let target_env_gnu_like = matches ! ( & target. target_env[ ..] , "gnu" | "musl" ) ;
25442545 let win_x64_gnu =
25452546 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 ;
25522553 let rust_abi = match sig. abi {
25532554 RustIntrinsic | PlatformIntrinsic | Rust | RustCall => true ,
25542555 _ => false ,
@@ -2619,11 +2620,13 @@ where
26192620 if arg. layout . is_zst ( ) {
26202621 // For some forsaken reason, x86_64-pc-windows-gnu
26212622 // 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}.
26242624 if is_return
26252625 || 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)
26272630 {
26282631 arg. mode = PassMode :: Ignore ;
26292632 }
0 commit comments