Skip to content

Fix attribute order implementation#154781

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
JonathanBrouwer:fix-attr-order
Apr 17, 2026
Merged

Fix attribute order implementation#154781
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
JonathanBrouwer:fix-attr-order

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer commented Apr 3, 2026

The implementation in #153041 contained a mistake :c
I swapped the place where the error message was on, but did not change any code for which attribute was also selected, which explains the empty crater results.
Interestingly, the original code is broken too, before #153041 it always took the last attribute, regardless of what the AttributeOrder actually was...

Let's first see crater results before making a decision

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 3, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

JonathanBrouwer commented Apr 3, 2026

@bors try

cc @jdonszelmann

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 3, 2026
@JonathanBrouwer

This comment was marked as outdated.

@craterbot

This comment was marked as outdated.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 3, 2026

☀️ Try build successful (CI)
Build commit: 9228062 (9228062c11d321a3ea08123f57e47533a3c88b00, parent: 2972b5e59f1c5529b6ba770437812fd83ab4ebd4)

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@craterbot check

@craterbot
Copy link
Copy Markdown
Collaborator

👌 Experiment pr-154781 created and queued.
🤖 Automatically detected try build 9228062
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 4, 2026
@craterbot
Copy link
Copy Markdown
Collaborator

🚧 Experiment pr-154781 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-154781 is completed!
📊 7 regressed and 5 fixed (879211 total)
📊 5136 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-154781/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Apr 16, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

All crater regressions & fixed look spurious to me.
I'm not sure whether we should bother T-lang with this, since they already approved this change in #153041, there are no crater results, and this is basically a "bug fix" from the previous PR. How do you feel about this @jdonszelmann?

r? @jdonszelmann

@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review April 17, 2026 10:39
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@jdonszelmann
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 17, 2026

📌 Commit 6f96878 has been approved by jdonszelmann

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

Rollup of 5 pull requests

Successful merges:

 - #154781 (Fix attribute order implementation)
 - #155242 (resolve: Introduce `(Local,Extern)Module` newtypes for local and external modules respectively)
 - #149614 (Use `MaybeDangling` in `std`)
 - #153178 (Add `TryFromIntError::kind` method and `IntErrorKind::NotAPowerOfTwo` variant)
 - #155049 (Documenting the case of `Weak::upgrade` returning `None` when the value behind the reference is missing)

Failed merges:

 - #155308 (Make `OnDuplicate::Error` the default for attributes)
rust-bors Bot pushed a commit that referenced this pull request Apr 17, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #154781 (Fix attribute order implementation)
 - #155242 (resolve: Introduce `(Local,Extern)Module` newtypes for local and external modules respectively)
 - #149614 (Use `MaybeDangling` in `std`)
 - #153178 (Add `TryFromIntError::kind` method and `IntErrorKind::NotAPowerOfTwo` variant)
 - #155049 (Documenting the case of `Weak::upgrade` returning `None` when the value behind the reference is missing)

Failed merges:

 - #155308 (Make `OnDuplicate::Error` the default for attributes)
@rust-bors rust-bors Bot merged commit c142d80 into rust-lang:main Apr 17, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 17, 2026
rust-timer added a commit that referenced this pull request Apr 17, 2026
Rollup merge of #154781 - JonathanBrouwer:fix-attr-order, r=jdonszelmann

Fix attribute order implementation

The implementation in #153041 contained a mistake :c
I swapped the place where the error message was on, but did not change any code for which attribute was also selected, which explains the empty crater results.
**Interestingly, the original code is broken too, before #153041 it always took the last attribute, regardless of what the `AttributeOrder` actually was...**

Let's first see crater results before making a decision

TODO for this PR: Make better tests for this
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@rust-timer build 7131292

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7131292): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.91s -> 491.403s (0.10%)
Artifact size: 394.18 MiB -> 394.16 MiB (-0.01%)

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.

5 participants