Repository: rust-lang/rust
File: compiler/rustc_target/src/target_features.rs (Rust)

Code before:
                    "ilp32d" | "lp64d" => {
                        // Requires d (which implies f), incompatible with nothing.
                        FeatureConstraints { required: &["d"], incompatible: &[] }
                    }
                    "ilp32f" | "lp64f" => {
                        // Requires f, incompatible with nothing.
                        FeatureConstraints { required: &["f"], incompatible: &[] }
                    }
                    "ilp32s" | "lp64s" => {
                        // The soft-float ABI does not require any features and is also not
                        // incompatible with any features. Rust targets explicitly specify the
                        // LLVM ABI names, which allows for enabling hard-float support even on
                        // soft-float targets, and ensures that the ABI behavior is as expected.
                        NOTHING
                    }
                    _ => unreachable!(),
                }
            }
            Arch::S390x => {
                // Same as x86, We use our own ABI indicator here;
                // LLVM does not have anything native and will switch ABI based
                // on the soft-float target feature.
                // Every case should require or forbid `soft-float`!
                // The "vector" target feature may only be used without soft-float
                // because the float and vector registers overlap and the the
                // standard s390x abi may pass vectors via this registers.
                match self.rustc_abi {
                    None => {
                        // Default hardfloat ABI.
                        FeatureConstraints { required: &[], incompatible: &["soft-float"] }
                    }
                    Some(RustcAbi::Softfloat) => {
                        // Softfloat ABI, requires corresponding target feature.
                        // llvm will switch to soft-float ABI just based on this feature.
                        FeatureConstraints { required: &["soft-float"], incompatible: &["vector"] }
                    }
                    Some(r) => {
                        panic!("invalid Rust ABI for s390x: {r:?}");
                    }
                }
            }
            _ => NOTHING,
        }
    }
}


Review comment (suggestion):
```suggestion
                // because the float and vector registers overlap and the
                // standard s390x C ABI may pass vectors via these registers.
```

Code after:
                    "ilp32d" | "lp64d" => {
                        // Requires d (which implies f), incompatible with nothing.
                        FeatureConstraints { required: &["d"], incompatible: &[] }
                    }
                    "ilp32f" | "lp64f" => {
                        // Requires f, incompatible with nothing.
                        FeatureConstraints { required: &["f"], incompatible: &[] }
                    }
                    "ilp32s" | "lp64s" => {
                        // The soft-float ABI does not require any features and is also not
                        // incompatible with any features. Rust targets explicitly specify the
                        // LLVM ABI names, which allows for enabling hard-float support even on
                        // soft-float targets, and ensures that the ABI behavior is as expected.
                        NOTHING
                    }
                    _ => unreachable!(),
                }
            }
            Arch::S390x => {
                // Same as x86, We use our own ABI indicator here;
                // LLVM does not have anything native and will switch ABI based
                // on the soft-float target feature.
                // Every case should require or forbid `soft-float`!
                // The "vector" target feature may only be used without soft-float
                // because the float and vector registers overlap and the
                // standard s390x C ABI may pass vectors via these registers.
                match self.rustc_abi {
                    None => {
                        // Default hardfloat ABI.
                        FeatureConstraints { required: &[], incompatible: &["soft-float"] }
                    }
                    Some(RustcAbi::Softfloat) => {
                        // Softfloat ABI, requires corresponding target feature.
                        // llvm will switch to soft-float ABI just based on this feature.
                        FeatureConstraints { required: &["soft-float"], incompatible: &["vector"] }
                    }
                    Some(r) => {
                        panic!("invalid Rust ABI for s390x: {r:?}");
                    }
                }
            }
            _ => NOTHING,
        }
    }
}