@@ -16,7 +16,6 @@ declare_lint_pass! {
1616 /// that are used by other parts of the compiler.
1717 HardwiredLints => [
1818 // tidy-alphabetical-start
19- ABI_UNSUPPORTED_VECTOR_TYPES ,
2019 ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE ,
2120 AMBIGUOUS_ASSOCIATED_ITEMS ,
2221 AMBIGUOUS_GLOB_IMPORTS ,
@@ -5029,69 +5028,3 @@ declare_lint! {
50295028 } ;
50305029 crate_level_only
50315030}
5032-
5033- declare_lint ! {
5034- /// The `abi_unsupported_vector_types` lint detects function definitions and calls
5035- /// whose ABI depends on enabling certain target features, but those features are not enabled.
5036- ///
5037- /// ### Example
5038- ///
5039- /// ```rust,ignore (fails on non-x86_64)
5040- /// extern "C" fn missing_target_feature(_: std::arch::x86_64::__m256) {
5041- /// todo!()
5042- /// }
5043- ///
5044- /// #[target_feature(enable = "avx")]
5045- /// unsafe extern "C" fn with_target_feature(_: std::arch::x86_64::__m256) {
5046- /// todo!()
5047- /// }
5048- ///
5049- /// fn main() {
5050- /// let v = unsafe { std::mem::zeroed() };
5051- /// unsafe { with_target_feature(v); }
5052- /// }
5053- /// ```
5054- ///
5055- /// ```text
5056- /// warning: ABI error: this function call uses a avx vector type, which is not enabled in the caller
5057- /// --> lint_example.rs:18:12
5058- /// |
5059- /// | unsafe { with_target_feature(v); }
5060- /// | ^^^^^^^^^^^^^^^^^^^^^^ function called here
5061- /// |
5062- /// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5063- /// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5064- /// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5065- /// = note: `#[warn(abi_unsupported_vector_types)]` on by default
5066- ///
5067- ///
5068- /// warning: ABI error: this function definition uses a avx vector type, which is not enabled
5069- /// --> lint_example.rs:3:1
5070- /// |
5071- /// | pub extern "C" fn with_target_feature(_: std::arch::x86_64::__m256) {
5072- /// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
5073- /// |
5074- /// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5075- /// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5076- /// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5077- /// ```
5078- ///
5079- ///
5080- ///
5081- /// ### Explanation
5082- ///
5083- /// The C ABI for `__m256` requires the value to be passed in an AVX register,
5084- /// which is only possible when the `avx` target feature is enabled.
5085- /// Therefore, `missing_target_feature` cannot be compiled without that target feature.
5086- /// A similar (but complementary) message is triggered when `with_target_feature` is called
5087- /// by a function that does not enable the `avx` target feature.
5088- ///
5089- /// Note that this lint is very similar to the `-Wpsabi` warning in `gcc`/`clang`.
5090- pub ABI_UNSUPPORTED_VECTOR_TYPES ,
5091- Warn ,
5092- "this function call or definition uses a vector type which is not enabled" ,
5093- @future_incompatible = FutureIncompatibleInfo {
5094- reason: FutureIncompatibilityReason :: FutureReleaseErrorDontReportInDeps ,
5095- reference: "issue #116558 <https://github.com/rust-lang/rust/issues/116558>" ,
5096- } ;
5097- }
0 commit comments