rust/tests/ui/simd-abi-checks.stderr
Luca Versari 5af56cac38 Emit error when calling/declaring functions with unavailable vectors.
On some architectures, vector types may have a different ABI when
relevant target features are enabled.

As discussed in https://github.com/rust-lang/lang-team/issues/235, this
turns out to very easily lead to unsound code.

This commit makes it an error 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.
2024-10-25 08:46:40 +02:00

94 lines
5.4 KiB
Plaintext

warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:55:11
|
LL | f(g());
| ^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
= note: `#[warn(abi_unsupported_vector_types)]` on by default
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:55:9
|
LL | f(g());
| ^^^^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:63:14
|
LL | gavx(favx());
| ^^^^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:63:9
|
LL | gavx(favx());
| ^^^^^^^^^^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:75:19
|
LL | w(Wrapper(g()));
| ^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks.rs:75:9
|
LL | w(Wrapper(g()));
| ^^^^^^^^^^^^^^^ function called 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function definition uses a vector type that requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks.rs:26:1
|
LL | unsafe extern "C" fn g() -> __m256 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function definition uses a vector type that requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks.rs:20:1
|
LL | unsafe extern "C" fn f(_: __m256) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: ABI error: this function definition uses a vector type that requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks.rs:14:1
|
LL | unsafe extern "C" fn w(_: Wrapper) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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=+avx`) or locally (`#[target_feature(enable="avx")]`)
warning: 9 warnings emitted