diagnostics improvements for invalid target_feature error #109531
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-target-feature
Area: Enabling/disabling target features like AVX, Neon, etc.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When a target feature is found that doesn't exist on the current target but does exist on another target, it should be explicitly pointed out in the error message. Copying the example from this comment:
When you compile it on M1/M2 you get:
Ideally this would mention that these target features are valid for the
arm64
target architecture/family:The printing also ideally would support features present on multiple target architectures, for example the
aes
feature is present on both arm and x86:For
aarch64
vsarm
it might make sense to always mention them both if the feature is present on both, as the two languages are way different from each other (while x86 is very backwards compatible).As a second thing, it would be nice if it could provide typo suggestions:
But I'm less sure if this is a good idea as target features are often very short and similar to each other. Suggesting the wrong target feature might not be detected as easily.
@rustbot label A-diagnostics A-target-feature
The text was updated successfully, but these errors were encountered: