You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #139309 - RalfJung:abi_unsupported_vector_types, r=fee1-dead,traviscross
make abi_unsupported_vector_types a hard error
Fixes#116558 by completing the transition; see that issue for context. The lint was introduced with Rust 1.84 and this has been shown in cargo's future breakage reports since Rust 1.85, released 6 weeks ago, and so far we got 0 complaints by users. There's not even a backlink on the tracking issue. We did a [crater run](#127731 (comment)) when the lint was originally added and found no breakage. So I don't think we need another crater run now, but I can do one if the team prefers that.
#131800 is done, so for most current targets (in particular, all tier 1 and tier 2 targets) we have the information to implement this check (modulo the targets where we don't properly support SIMD vectors yet, see the sub-issues of #116558). If a new target gets added in the future, it will default to reject all SIMD vector types until proper information is added, which is the default we want.
This will need approval by for `@rust-lang/lang.` Cc `@workingjubilee` `@veluca93`
try-job: test-various
try-job: armhf-gnu
/// warning: ABI error: this function call uses a avx vector type, which is not enabled in the caller
5056
-
/// --> lint_example.rs:18:12
5057
-
/// |
5058
-
/// | unsafe { with_target_feature(v); }
5059
-
/// | ^^^^^^^^^^^^^^^^^^^^^^ function called here
5060
-
/// |
5061
-
/// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5062
-
/// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5063
-
/// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5064
-
/// = note: `#[warn(abi_unsupported_vector_types)]` on by default
5065
-
///
5066
-
///
5067
-
/// warning: ABI error: this function definition uses a avx vector type, which is not enabled
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
5072
-
/// |
5073
-
/// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5074
-
/// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5075
-
/// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5076
-
/// ```
5077
-
///
5078
-
///
5079
-
///
5080
-
/// ### Explanation
5081
-
///
5082
-
/// The C ABI for `__m256` requires the value to be passed in an AVX register,
5083
-
/// which is only possible when the `avx` target feature is enabled.
5084
-
/// Therefore, `missing_target_feature` cannot be compiled without that target feature.
5085
-
/// A similar (but complementary) message is triggered when `with_target_feature` is called
5086
-
/// by a function that does not enable the `avx` target feature.
5087
-
///
5088
-
/// Note that this lint is very similar to the `-Wpsabi` warning in `gcc`/`clang`.
5089
-
pubABI_UNSUPPORTED_VECTOR_TYPES,
5090
-
Warn,
5091
-
"this function call or definition uses a vector type which is not enabled",
0 commit comments