mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
c8b76bcf58
On some architectures, vector types may have a different ABI depending on whether the relevant target features are enabled. (The ABI when the feature is disabled is often not specified, but LLVM implements some de-facto ABI.) As discussed in rust-lang/lang-team#235, this turns out to very easily lead to unsound code. This commit makes it a post-monomorphization future-incompat warning to declare or call functions using those vector types in a context in which the corresponding target features are disabled, if using an ABI for which the difference is relevant. This ensures that these functions are always called with a consistent ABI. See the [nomination comment](https://github.com/rust-lang/rust/pull/127731#issuecomment-2288558187) for more discussion. Part of #116558
14 lines
728 B
Plaintext
14 lines
728 B
Plaintext
warning: ABI error: this function definition uses a vector type that requires the `sse` target feature, which is not enabled
|
|
--> $DIR/sse-abi-checks.rs:21:1
|
|
|
|
|
LL | pub unsafe extern "C" fn f(_: SseVector) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
= note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
|
|
= help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
|
|
= note: `#[warn(abi_unsupported_vector_types)]` on by default
|
|
|
|
warning: 1 warning emitted
|
|
|