Skip to content

suggest valid features when target feature is invalid#153966

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:suggest-target-feature-names
Mar 17, 2026
Merged

suggest valid features when target feature is invalid#153966
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:suggest-target-feature-names

Conversation

@folkertdev
Copy link
Contributor

I run into this quite frequently, where I remember some part of a feature name but not the exact name. Now this emits suggestions like

error: the feature named `+avx512` is not valid for this target
  --> $DIR/invalid-attribute.rs:127:18
   |
LL | #[target_feature(enable = "+avx512")]
   |                  ^^^^^^^^^^^^^^^^^^ `+avx512` is not valid for this target
   |
   = help: valid names are: `avx512f`, `avx2`, `avx512bw`, `avx512cd`, and `avx512dq` and 74 more

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 16, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 69 candidates
  • Random selection from 15 candidates

Copy link
Member

@mati865 mati865 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

📌 Commit cd4fd28 has been approved by mati865

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 17, 2026
…names, r=mati865

suggest valid features when target feature is invalid

I run into this quite frequently, where I remember some part of a feature name but not the exact name. Now this emits suggestions like

```
error: the feature named `+avx512` is not valid for this target
  --> $DIR/invalid-attribute.rs:127:18
   |
LL | #[target_feature(enable = "+avx512")]
   |                  ^^^^^^^^^^^^^^^^^^ `+avx512` is not valid for this target
   |
   = help: valid names are: `avx512f`, `avx2`, `avx512bw`, `avx512cd`, and `avx512dq` and 74 more
```
rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
Rollup of 5 pull requests

Successful merges:

 - #146013 (Add `From` impls for wrapper types)
 - #153966 (suggest valid features when target feature is invalid)
 - #153372 (Fix LegacyKeyValueFormat report from docker build: x86_64-gnu)
 - #153738 (Don't look for non-type-level assoc consts when checking trait object types)
 - #153921 (Suppress self-referential associated type constraint suggestion)
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 17, 2026
…names, r=mati865

suggest valid features when target feature is invalid

I run into this quite frequently, where I remember some part of a feature name but not the exact name. Now this emits suggestions like

```
error: the feature named `+avx512` is not valid for this target
  --> $DIR/invalid-attribute.rs:127:18
   |
LL | #[target_feature(enable = "+avx512")]
   |                  ^^^^^^^^^^^^^^^^^^ `+avx512` is not valid for this target
   |
   = help: valid names are: `avx512f`, `avx2`, `avx512bw`, `avx512cd`, and `avx512dq` and 74 more
```
rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
Rollup of 5 pull requests

Successful merges:

 - #153966 (suggest valid features when target feature is invalid)
 - #153372 (Fix LegacyKeyValueFormat report from docker build: x86_64-gnu)
 - #153738 (Don't look for non-type-level assoc consts when checking trait object types)
 - #153907 (Remove redundant fields from `QueryStackFrame`)
 - #153921 (Suppress self-referential associated type constraint suggestion)
@rust-bors rust-bors bot merged commit f08ebf3 into rust-lang:main Mar 17, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants