-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
target_feature 1.1 error should print the list of missing target features #108680
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-target_feature_11target feature 1.1 RFCtarget feature 1.1 RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-target_feature_11target feature 1.1 RFCtarget feature 1.1 RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given the following code:
The current output is:
The note is easy to be misinterpreted: the function can also be called if the target features are not available, but it requires an
unsafeannotation.I think it would be nice for the note to list the missing target features. In this case, this would be
sse2andavx.If one or more of the missing target features are enabled in the current build config, like via
-C target-featureor-C target-cpu, or because the default is just that, then it should acknowledge this situation and explain that a#[target_feature]is still required.So I'd imagine something like:
TLDR: I ask for two things:
notein the general case (I think what it contains is already said in the main error msg), but if there are missing target features that are enabled in the build configuration, emit a note to point out that even though they are enabled, this has no influence on#[target_feature](it's two different systems; see my example for the proposed wording)helpthat lists the missing target features (ideally if too many like more than 5 are missing, then cut the list to keep the error message short ("avx, sse2, sse, aes, foobar, and 3 more"))cc #69098
@rustbot label A-diagnostics F-target_feature_11