Skip to content

Cleanups around attribute target checking#157120

Open
JonathanBrouwer wants to merge 2 commits into
rust-lang:mainfrom
JonathanBrouwer:repr-target-checking
Open

Cleanups around attribute target checking#157120
JonathanBrouwer wants to merge 2 commits into
rust-lang:mainfrom
JonathanBrouwer:repr-target-checking

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

This is in preparation for a new approach I'm trying for #156569
So r? @mejrs

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 29, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@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 May 29, 2026
Copy link
Copy Markdown
Contributor

@mejrs mejrs left a comment

Choose a reason for hiding this comment

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

// people about accidentally not using them on the crate.
if let &AllowedTargets::AllowList(&[Allow(Target::Crate)]) = allowed_targets {
Self::check_crate_level(target, cx);
Self::check_crate_level(cx.target, cx);
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.

Looks like this function can just take cx 🤷‍♂️. For another day, I suppose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nah you're so right, I'll fix it

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 29, 2026

📌 Commit a39011e has been approved by mejrs

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 May 29, 2026
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 29, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 29, 2026

⚠️ A new commit 4f2faec60f844c6bb199606e8416a20dec55a224 was pushed.

This pull request was unapproved.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r=mejrs

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 29, 2026

📌 Commit 4f2faec has been approved by mejrs

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 29, 2026
…ng, r=mejrs

Cleanups around attribute target checking

This is in preparation for a new approach I'm trying for rust-lang#156569
So r? @mejrs
rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #149195 (resolve: Partially convert `ambiguous_glob_imports` lint into a hard error)
 - #156960 (Some cleanups around passing extra lifetime params from the resolver to ast lowering)
 - #156963 (definitions: remove `DefPathTable`, use `LocalDefId` instead of `DefIndex`)
 - #157053 (Eagerly resolve delegations in late resolution)
 - #157068 (NVPTX: Remove the unstable ptx linker flavor)
 - #157076 (Various proc-macro related code cleanups)
 - #157106 (add ABI check logic for wasm)
 - #154835 (std::offload sharedmem)
 - #157065 (Stabilize `Path::is_empty`)
 - #157088 (Improve suggestions for malformed deprecated attribute)
 - #157098 (Add the `clflushopt` x86 target feature)
 - #157103 (Add reproducibly failing tests for parallel frontend)
 - #157111 (Update target maintainer for x86_64-unknown-linux-none)
 - #157116 (rustc_public: add `with_cx()` to `CompilerInterface`)
 - #157119 (ast_lowering: Simplify `resolve_pin_drop_sugar_impl_item`)
 - #157120 (Cleanups around attribute target checking)

Failed merges:

 - #157100 (Some more per owner things)
rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #149195 (resolve: Partially convert `ambiguous_glob_imports` lint into a hard error)
 - #156960 (Some cleanups around passing extra lifetime params from the resolver to ast lowering)
 - #156963 (definitions: remove `DefPathTable`, use `LocalDefId` instead of `DefIndex`)
 - #157053 (Eagerly resolve delegations in late resolution)
 - #157068 (NVPTX: Remove the unstable ptx linker flavor)
 - #157076 (Various proc-macro related code cleanups)
 - #157106 (add ABI check logic for wasm)
 - #154835 (std::offload sharedmem)
 - #157065 (Stabilize `Path::is_empty`)
 - #157088 (Improve suggestions for malformed deprecated attribute)
 - #157098 (Add the `clflushopt` x86 target feature)
 - #157103 (Add reproducibly failing tests for parallel frontend)
 - #157111 (Update target maintainer for x86_64-unknown-linux-none)
 - #157116 (rustc_public: add `with_cx()` to `CompilerInterface`)
 - #157119 (ast_lowering: Simplify `resolve_pin_drop_sugar_impl_item`)
 - #157120 (Cleanups around attribute target checking)

Failed merges:

 - #157100 (Some more per owner things)
rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #149195 (resolve: Partially convert `ambiguous_glob_imports` lint into a hard error)
 - #156960 (Some cleanups around passing extra lifetime params from the resolver to ast lowering)
 - #156963 (definitions: remove `DefPathTable`, use `LocalDefId` instead of `DefIndex`)
 - #157053 (Eagerly resolve delegations in late resolution)
 - #157068 (NVPTX: Remove the unstable ptx linker flavor)
 - #157076 (Various proc-macro related code cleanups)
 - #157106 (add ABI check logic for wasm)
 - #154835 (std::offload sharedmem)
 - #157065 (Stabilize `Path::is_empty`)
 - #157088 (Improve suggestions for malformed deprecated attribute)
 - #157098 (Add the `clflushopt` x86 target feature)
 - #157103 (Add reproducibly failing tests for parallel frontend)
 - #157111 (Update target maintainer for x86_64-unknown-linux-none)
 - #157116 (rustc_public: add `with_cx()` to `CompilerInterface`)
 - #157119 (ast_lowering: Simplify `resolve_pin_drop_sugar_impl_item`)
 - #157120 (Cleanups around attribute target checking)

Failed merges:

 - #157100 (Some more per owner things)
rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #149195 (resolve: Partially convert `ambiguous_glob_imports` lint into a hard error)
 - #156960 (Some cleanups around passing extra lifetime params from the resolver to ast lowering)
 - #156963 (definitions: remove `DefPathTable`, use `LocalDefId` instead of `DefIndex`)
 - #157053 (Eagerly resolve delegations in late resolution)
 - #157068 (NVPTX: Remove the unstable ptx linker flavor)
 - #157076 (Various proc-macro related code cleanups)
 - #157106 (add ABI check logic for wasm)
 - #154835 (std::offload sharedmem)
 - #157065 (Stabilize `Path::is_empty`)
 - #157088 (Improve suggestions for malformed deprecated attribute)
 - #157098 (Add the `clflushopt` x86 target feature)
 - #157103 (Add reproducibly failing tests for parallel frontend)
 - #157111 (Update target maintainer for x86_64-unknown-linux-none)
 - #157116 (rustc_public: add `with_cx()` to `CompilerInterface`)
 - #157119 (ast_lowering: Simplify `resolve_pin_drop_sugar_impl_item`)
 - #157120 (Cleanups around attribute target checking)

Failed merges:

 - #157100 (Some more per owner things)
rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
…uwer

Rollup of 16 pull requests



Successful merges:

 - #149195 (resolve: Partially convert `ambiguous_glob_imports` lint into a hard error)
 - #156960 (Some cleanups around passing extra lifetime params from the resolver to ast lowering)
 - #156963 (definitions: remove `DefPathTable`, use `LocalDefId` instead of `DefIndex`)
 - #157053 (Eagerly resolve delegations in late resolution)
 - #157068 (NVPTX: Remove the unstable ptx linker flavor)
 - #157076 (Various proc-macro related code cleanups)
 - #157106 (add ABI check logic for wasm)
 - #154835 (std::offload sharedmem)
 - #157065 (Stabilize `Path::is_empty`)
 - #157088 (Improve suggestions for malformed deprecated attribute)
 - #157098 (Add the `clflushopt` x86 target feature)
 - #157103 (Add reproducibly failing tests for parallel frontend)
 - #157111 (Update target maintainer for x86_64-unknown-linux-none)
 - #157116 (rustc_public: add `with_cx()` to `CompilerInterface`)
 - #157119 (ast_lowering: Simplify `resolve_pin_drop_sugar_impl_item`)
 - #157120 (Cleanups around attribute target checking)

Failed merges:

 - #157100 (Some more per owner things)
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