Skip to content

note which target a missing target_feature belongs to#157594

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rohaquinlop:issue-109531-diagnostic-improvements
Jun 13, 2026
Merged

note which target a missing target_feature belongs to#157594
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rohaquinlop:issue-109531-diagnostic-improvements

Conversation

@rohaquinlop

@rohaquinlop rohaquinlop commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR attempts to improve diagnostics for invalid target_feature error, many years ago I experienced that error

Closes: #109531

@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 Jun 8, 2026
@rustbot

rustbot commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

r? @adwinwhite

rustbot has assigned @adwinwhite.
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 73 candidates
  • Random selection from 19 candidates

@rustbot

This comment has been minimized.

@rohaquinlop rohaquinlop changed the title Issue 109531 diagnostic improvements note which target a missing target_feature belongs to Jun 8, 2026
@rohaquinlop rohaquinlop force-pushed the issue-109531-diagnostic-improvements branch 2 times, most recently from b0a744f to 777b941 Compare June 8, 2026 03:09
Comment thread compiler/rustc_codegen_ssa/src/target_features.rs Outdated
Comment thread tests/ui/target-feature/cross-arch-feature-note.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2026
@rustbot

rustbot commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

When #[target_feature(enable = "sse2")] is used on an aarch64
target, the error now includes a note naming the target architecture
where the feature IS valid, e.g.:

  = note: `sse2` is present on the `x86` target architecture.
  Did you mean to compile for that target, or use conditional
  compilation?

Multi-arch features (e.g. aes on arm+aarch64+x86) get the plural
form listing all matching architectures.
@rohaquinlop rohaquinlop force-pushed the issue-109531-diagnostic-improvements branch from 777b941 to 349075b Compare June 8, 2026 15:14
@rohaquinlop

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 8, 2026
@rohaquinlop rohaquinlop requested a review from folkertdev June 8, 2026 17:06
@rohaquinlop

Copy link
Copy Markdown
Contributor Author

r?

@rustbot

rustbot commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Error: Parsing assign command in comment failed: specify user to assign to (if you want to reroll without a specific reviewer in mind, use @rustbot reroll)

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@folkertdev

Copy link
Copy Markdown
Contributor

r? me

@rustbot rustbot assigned folkertdev and unassigned adwinwhite Jun 13, 2026
@folkertdev

Copy link
Copy Markdown
Contributor

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 349075b has been approved by folkertdev

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 Jun 13, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 13, 2026
Rollup of 10 pull requests

Successful merges:

 - #157714 (Improve polymorphization of raw pointer formatting)
 - #157653 (remove AliasTerm::def_id())
 - #157773 (Remove AnonConstKind::GCA and reject generic anon consts)
 - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums)
 - #157594 (note which target a missing target_feature belongs to)
 - #157740 (rustdoc: correct doctest span for trailing semicolon after item)
 - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`)
 - #157802 (Ensure that optimize attributes on closures are inherited by the shim.)
 - #157812 (rustc_public: implement `ty::Alias` conversion)
 - #157833 (Update wasm-component-ld to 0.5.25)
rust-bors Bot pushed a commit that referenced this pull request Jun 13, 2026
Rollup of 10 pull requests

Successful merges:

 - #157714 (Improve polymorphization of raw pointer formatting)
 - #157653 (remove AliasTerm::def_id())
 - #157773 (Remove AnonConstKind::GCA and reject generic anon consts)
 - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums)
 - #157594 (note which target a missing target_feature belongs to)
 - #157740 (rustdoc: correct doctest span for trailing semicolon after item)
 - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`)
 - #157802 (Ensure that optimize attributes on closures are inherited by the shim.)
 - #157812 (rustc_public: implement `ty::Alias` conversion)
 - #157833 (Update wasm-component-ld to 0.5.25)
@rust-bors rust-bors Bot merged commit 85bbfba into rust-lang:main Jun 13, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 13, 2026
rust-timer added a commit that referenced this pull request Jun 13, 2026
Rollup merge of #157594 - rohaquinlop:issue-109531-diagnostic-improvements, r=folkertdev

note which target a missing target_feature belongs to

This PR attempts to improve diagnostics for invalid `target_feature` error, many years ago I experienced that [error](#108680 (comment))

Closes: #109531
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.

diagnostics improvements for invalid target_feature error

4 participants