Skip to content

Move check_target_feature into the attribute parser#158313

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
obeis:move-check_target_feature
Jun 27, 2026
Merged

Move check_target_feature into the attribute parser#158313
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
obeis:move-check_target_feature

Conversation

@obeis

@obeis obeis commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Updates #153101

Use TargetFeatureParser to reject #[target_feature] on functions marked as lang items (via #[lang = "..."] or #[panic_handler]), replacing check_target_feature in rustc_passes.

r? @JonathanBrouwer

@rustbot

rustbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 23, 2026
@obeis obeis force-pushed the move-check_target_feature branch from 9881ee7 to 284b9e1 Compare June 24, 2026 14:54
@rust-bors

This comment has been minimized.

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you make the same change here as in #158361?

View changes since this review

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

rustbot commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

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

Comment thread compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs Outdated
Use `TargetFeatureParser` to reject `#[target_feature]` on functions
marked as lang items (via `#[lang = "..."]` or `#[panic_handler]`),
replacing `check_target_feature` in `rustc_passes`.
@obeis obeis force-pushed the move-check_target_feature branch from 284b9e1 to 74830a7 Compare June 27, 2026 08:27
@rustbot

rustbot commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@obeis obeis requested a review from JonathanBrouwer June 27, 2026 08:29
@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 27, 2026

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 74830a7 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@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 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #157871 ([rustdoc] Update `doc_cfg` hide/show syntax)
 - #158234 (Cross-referencing tuple_trait tracking issue, source and the Unstable Book)
 - #158480 (add smoketest for std::net::hostname)
 - #157625 (Use infer tys for synthetic params when lowering const paths point to fns)
 - #158290 (add crashtests [1/N])
 - #158306 (tests: modify s390x vector test to be robust to instruction scheduling)
 - #158313 (Move `check_target_feature` into the attribute parser)
 - #158431 (More lint cleanups)
 - #158452 (Add missing links in integer docs)
 - #158467 (Add proc macro for unused assignments and corresponding test)
 - #158472 (Add regression test for unexpected pointer dereference issue)
 - #158475 (Fix doc comment on get_debug_as_hex.)
 - #158476 (Fix doc comment on FormattingOptions::new().)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #157871 ([rustdoc] Update `doc_cfg` hide/show syntax)
 - #158234 (Cross-referencing tuple_trait tracking issue, source and the Unstable Book)
 - #158480 (add smoketest for std::net::hostname)
 - #157625 (Use infer tys for synthetic params when lowering const paths point to fns)
 - #158290 (add crashtests [1/N])
 - #158306 (tests: modify s390x vector test to be robust to instruction scheduling)
 - #158313 (Move `check_target_feature` into the attribute parser)
 - #158431 (More lint cleanups)
 - #158452 (Add missing links in integer docs)
 - #158467 (Add proc macro for unused assignments and corresponding test)
 - #158472 (Add regression test for unexpected pointer dereference issue)
 - #158475 (Fix doc comment on get_debug_as_hex.)
 - #158476 (Fix doc comment on FormattingOptions::new().)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #157871 ([rustdoc] Update `doc_cfg` hide/show syntax)
 - #158234 (Cross-referencing tuple_trait tracking issue, source and the Unstable Book)
 - #158480 (add smoketest for std::net::hostname)
 - #157625 (Use infer tys for synthetic params when lowering const paths point to fns)
 - #158290 (add crashtests [1/N])
 - #158306 (tests: modify s390x vector test to be robust to instruction scheduling)
 - #158313 (Move `check_target_feature` into the attribute parser)
 - #158431 (More lint cleanups)
 - #158452 (Add missing links in integer docs)
 - #158467 (Add proc macro for unused assignments and corresponding test)
 - #158472 (Add regression test for unexpected pointer dereference issue)
 - #158475 (Fix doc comment on get_debug_as_hex.)
 - #158476 (Fix doc comment on FormattingOptions::new().)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #157871 ([rustdoc] Update `doc_cfg` hide/show syntax)
 - #158234 (Cross-referencing tuple_trait tracking issue, source and the Unstable Book)
 - #158480 (add smoketest for std::net::hostname)
 - #157625 (Use infer tys for synthetic params when lowering const paths point to fns)
 - #158290 (add crashtests [1/N])
 - #158306 (tests: modify s390x vector test to be robust to instruction scheduling)
 - #158313 (Move `check_target_feature` into the attribute parser)
 - #158431 (More lint cleanups)
 - #158452 (Add missing links in integer docs)
 - #158467 (Add proc macro for unused assignments and corresponding test)
 - #158472 (Add regression test for unexpected pointer dereference issue)
 - #158475 (Fix doc comment on get_debug_as_hex.)
 - #158476 (Fix doc comment on FormattingOptions::new().)
@rust-bors rust-bors Bot merged commit ee6105a into rust-lang:main Jun 27, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 27, 2026
rust-timer added a commit that referenced this pull request Jun 27, 2026
Rollup merge of #158313 - obeis:move-check_target_feature, r=JonathanBrouwer

Move `check_target_feature` into the attribute parser

Updates #153101

Use `TargetFeatureParser` to reject `#[target_feature]` on functions marked as lang items (via `#[lang = "..."]` or `#[panic_handler]`), replacing `check_target_feature` in `rustc_passes`.

r? @JonathanBrouwer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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