Skip to content

Conversation

JonathanBrouwer
Copy link
Contributor

Ports used to the new attribute parsing infrastructure for #131229 (comment)

r? @jdonszelmann

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@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 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

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

cc @jdonszelmann

@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 21, 2025
@JonathanBrouwer
Copy link
Contributor Author

@rustbot author

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

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

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

☔ The latest upstream changes (presumably #142826) made this pull request unmergeable. Please resolve the merge conflicts.

@JonathanBrouwer
Copy link
Contributor Author

@rustbot ready
Implemented ratcheting behaviour & reverted change to the warning

@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 22, 2025
@JonathanBrouwer JonathanBrouwer force-pushed the used_new_parser branch 2 times, most recently from e70cbef to 30d851d Compare June 22, 2025 13:02
@JonathanBrouwer
Copy link
Contributor Author

Rebased to solve merge conflicts

@bors
Copy link
Collaborator

bors commented Jun 22, 2025

☔ The latest upstream changes (presumably #142878) made this pull request unmergeable. Please resolve the merge conflicts.

@JonathanBrouwer JonathanBrouwer force-pushed the used_new_parser branch 2 times, most recently from be02b70 to 0031aab Compare June 23, 2025 16:10
@jdonszelmann
Copy link
Contributor

jdonszelmann commented Jun 23, 2025

just to be clear @JonathanBrouwer, is the behavior right now exactly the same as before with regards to errors and which attribute applies in case of duplicates or not?

@JonathanBrouwer
Copy link
Contributor Author

@jdonszelmann
The behaviour regarding errors and duplicates is exactly the same when multiple identical attributes are specified. This provides a warning "unused attribute" without stating it will be removed.

When multiple different attributes are applied the behaviour has changed. This is fine because [used(arg)] with an argument is unstable.

What has changed:

#[used]
#[used(linker)]

Before: Error, "compiler and linker can't be used together". This is a wrong error since #[used] should be equivalent to #[used(linker)]
After: Changed: now a warning, unused attribute

#[used]
#[used(compiler)]

Before: No error, ratcheting behaviour so "linker " is used
After: unchanged

#[used(linker)]
#[used(compiler)]

Before: Error
After: Changed: Now also does ratcheting to linker.

@bors bors 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 26, 2025
@JonathanBrouwer
Copy link
Contributor Author

@jdonszelmann This one was not rebased on the encode-cross-crate PR yet, did that now ^

@jdonszelmann
Copy link
Contributor

Ah I see

@jdonszelmann
Copy link
Contributor

Whoops

@jdonszelmann
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 26, 2025

📌 Commit 9b3f729 has been approved by jdonszelmann

It is now in the queue for this repository.

compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 26, 2025
…=jdonszelmann

Port `#[used]` to new attribute parsing infrastructure

Ports `used` to the new attribute parsing infrastructure for rust-lang#131229 (comment)

r? `@jdonszelmann`
@jdonszelmann
Copy link
Contributor

@bors r-

@bors bors 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 Jun 26, 2025
@bors
Copy link
Collaborator

bors commented Jun 27, 2025

☔ The latest upstream changes (presumably #143074) made this pull request unmergeable. Please resolve the merge conflicts.

@JonathanBrouwer
Copy link
Contributor Author

@jdonszelmann rebased ^

@jdonszelmann
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit 9e35684 has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors 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 Jun 27, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 27, 2025
…=jdonszelmann

Port `#[used]` to new attribute parsing infrastructure

Ports `used` to the new attribute parsing infrastructure for rust-lang#131229 (comment)

r? `@jdonszelmann`
bors added a commit that referenced this pull request Jun 27, 2025
Rollup of 6 pull requests

Successful merges:

 - #142270 (Rustdoc js: even more typechecking improvements)
 - #142420 (Report infer ty errors during hir ty lowering)
 - #142818 (Port `#[used]` to new attribute parsing infrastructure)
 - #143020 (codegen_fn_attrs: make comment more precise)
 - #143036 (Remove support for `dyn*` from the compiler)
 - #143060 (Only args in main diag are saved and restored without removing the newly added ones)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 27, 2025
Rollup of 10 pull requests

Successful merges:

 - #142270 (Rustdoc js: even more typechecking improvements)
 - #142420 (Report infer ty errors during hir ty lowering)
 - #142671 (add #![rustc_no_implicit_bounds])
 - #142721 (Add tracing to `InterpCx::layout_of()` )
 - #142818 (Port `#[used]` to new attribute parsing infrastructure)
 - #143020 (codegen_fn_attrs: make comment more precise)
 - #143051 (Add tracing to `validate_operand`)
 - #143060 (Only args in main diag are saved and restored without removing the newly added ones)
 - #143065 (Improve recovery when users write `where:`)
 - #143084 (const-eval: error when initializing a static writes to that static)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3c3a174 into rust-lang:master Jun 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 27, 2025
rust-timer added a commit that referenced this pull request Jun 27, 2025
Rollup merge of #142818 - JonathanBrouwer:used_new_parser, r=jdonszelmann

Port `#[used]` to new attribute parsing infrastructure

Ports `used` to the new attribute parsing infrastructure for #131229 (comment)

r? ``@jdonszelmann``
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 28, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#142270 (Rustdoc js: even more typechecking improvements)
 - rust-lang/rust#142420 (Report infer ty errors during hir ty lowering)
 - rust-lang/rust#142671 (add #![rustc_no_implicit_bounds])
 - rust-lang/rust#142721 (Add tracing to `InterpCx::layout_of()` )
 - rust-lang/rust#142818 (Port `#[used]` to new attribute parsing infrastructure)
 - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise)
 - rust-lang/rust#143051 (Add tracing to `validate_operand`)
 - rust-lang/rust#143060 (Only args in main diag are saved and restored without removing the newly added ones)
 - rust-lang/rust#143065 (Improve recovery when users write `where:`)
 - rust-lang/rust#143084 (const-eval: error when initializing a static writes to that static)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

6 participants