@@ -16,6 +16,7 @@ declare_lint_pass! {
16
16
/// that are used by other parts of the compiler.
17
17
HardwiredLints => [
18
18
// tidy-alphabetical-start
19
+ AARCH64_SOFTFLOAT_NEON ,
19
20
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE ,
20
21
AMBIGUOUS_ASSOCIATED_ITEMS ,
21
22
AMBIGUOUS_GLOB_IMPORTS ,
@@ -5043,14 +5044,14 @@ declare_lint! {
5043
5044
///
5044
5045
/// ```text
5045
5046
/// error: this function function definition is affected by the wasm ABI transition: it passes an argument of non-scalar type `MyType`
5046
- /// --> $DIR/wasm_c_abi_transition.rs:17:1
5047
- /// |
5048
- /// | pub extern "C" fn my_fun(_x: MyType) {}
5049
- /// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5050
- /// |
5051
- /// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5052
- /// = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762>
5053
- /// = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target
5047
+ /// --> $DIR/wasm_c_abi_transition.rs:17:1
5048
+ /// |
5049
+ /// | pub extern "C" fn my_fun(_x: MyType) {}
5050
+ /// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5051
+ /// |
5052
+ /// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5053
+ /// = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762>
5054
+ /// = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target
5054
5055
/// ```
5055
5056
///
5056
5057
/// ### Explanation
@@ -5067,3 +5068,44 @@ declare_lint! {
5067
5068
reference: "issue #138762 <https://github.com/rust-lang/rust/issues/138762>" ,
5068
5069
} ;
5069
5070
}
5071
+
5072
+ declare_lint ! {
5073
+ /// The `aarch64_softfloat_neon` lint detects usage of `#[target_feature(enable = "neon")]` on
5074
+ /// softfloat aarch64 targets. Enabling this target feature causes LLVM to alter the ABI of
5075
+ /// function calls, making this attribute unsound to use.
5076
+ ///
5077
+ /// ### Example
5078
+ ///
5079
+ /// ```rust,ignore (needs aarch64-unknown-none-softfloat)
5080
+ /// #[target_feature(enable = "neon")]
5081
+ /// fn with_neon() {}
5082
+ /// ```
5083
+ ///
5084
+ /// This will produce:
5085
+ ///
5086
+ /// ```text
5087
+ /// error: enabling the `neon` target feature on the current target is unsound due to ABI issues
5088
+ /// --> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:11:18
5089
+ /// |
5090
+ /// | #[target_feature(enable = "neon")]
5091
+ /// | ^^^^^^^^^^^^^^^
5092
+ /// |
5093
+ /// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5094
+ /// = note: for more information, see issue #134375 <https://github.com/rust-lang/rust/issues/134375>
5095
+ /// ```
5096
+ ///
5097
+ /// ### Explanation
5098
+ ///
5099
+ /// If a function like `with_neon` above ends up containing calls to LLVM builtins, those will
5100
+ /// not use the correct ABI. This is caused by a lack of support in LLVM for mixing code with
5101
+ /// and without the `neon` target feature. The target feature should never have been stabilized
5102
+ /// on this target due to this issue, but the problem was not known at the time of
5103
+ /// stabilization.
5104
+ pub AARCH64_SOFTFLOAT_NEON ,
5105
+ Warn ,
5106
+ "detects code that could be affected by ABI issues on aarch64 softfloat targets" ,
5107
+ @future_incompatible = FutureIncompatibleInfo {
5108
+ reason: FutureIncompatibilityReason :: FutureReleaseErrorReportInDeps ,
5109
+ reference: "issue #134375 <https://github.com/rust-lang/rust/issues/134375>" ,
5110
+ } ;
5111
+ }
0 commit comments