Skip to content

Port #[rustc_layout_scalar_valid_range_start/end] to the new attrib… #142921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanBrouwer
Copy link
Contributor

Ports rustc_layout_scalar_valid_range_start and rustc_layout_scalar_valid_range_end to the new attribute parsing infrastructure for #131229 (comment)

r? @jdonszelmann

@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2025

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

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

cc @jdonszelmann

@JonathanBrouwer JonathanBrouwer force-pushed the rustc_attributes_parser branch from 46ea3f1 to 9102b14 Compare June 23, 2025 18:02
@@ -41,4 +41,5 @@ extern "C" {}

#[rustc_layout_scalar_valid_range_start(0suffix)]
//~^ ERROR invalid suffix `suffix` for number literal
//~| ERROR malformed `rustc_layout_scalar_valid_range_start` attribute input
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really like this change, but not sure how to fix it. I think my new lint is the one which should not be triggered, but I just get an attribute with an empty list with no way to detect that it is empty because something previously errored. @jdonszelmann advice?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure about this but this might be what dcx.has_stashed_diagnostic(span, StashKey) could be useful for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a hack I printed the entire stashed_diagnostics when parse_rustc_layout_scalar_valid_range is called and it is empty, so this does not seem to be the solution

Copy link
Contributor

Choose a reason for hiding this comment

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

yea because when the initial diagnostic is emitted, nothing is stashed with that stash key

Copy link
Contributor

Choose a reason for hiding this comment

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

take a look at the stash key enum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pretty printed the entire stashed_diagnostics map from dcx, it is empty. So what stash key I used shouldn't matter

@JonathanBrouwer JonathanBrouwer force-pushed the rustc_attributes_parser branch from 9102b14 to 49398cf Compare June 23, 2025 18:23
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 23, 2025
…t, r=jdonszelmann

Fix comment on NoMangle

Fix comment on NoMangle.
This was discussed in comments of rust-lang#142823 (comment) and rust-lang#142921
@aDotInTheVoid
Copy link
Member

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 23, 2025

⌛ Trying commit 49398cf with merge 600a41a

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 23, 2025
Port `#[rustc_layout_scalar_valid_range_start/end]` to the new attrib…

Ports `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` to the new attribute parsing infrastructure for #131229 (comment)

r? `@jdonszelmann`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 23, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 24, 2025

☀️ Try build successful (CI)
Build commit: 600a41a (600a41ac6ff1ea3a01ebd1fc0715b567826018f6, parent: 706f244db581212cabf2e619e0113d70999b2bbe)

@rust-timer

This comment has been minimized.

rust-timer added a commit that referenced this pull request Jun 24, 2025
Rollup merge of #142922 - JonathanBrouwer:fix-rustdoc-comment, r=jdonszelmann

Fix comment on NoMangle

Fix comment on NoMangle.
This was discussed in comments of #142823 (comment) and #142921
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (600a41a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
1.7% [0.3%, 3.0%] 2
Regressions ❌
(secondary)
0.2% [0.1%, 0.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) 1.7% [0.3%, 3.0%] 2

Max RSS (memory usage)

Results (primary 1.5%, secondary 0.6%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.3%, 1.8%] 2
Regressions ❌
(secondary)
4.0% [2.7%, 5.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-2.8%, -2.6%] 2
All ❌✅ (primary) 1.5% [1.3%, 1.8%] 2

Cycles

Results (primary 0.7%, secondary -2.4%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
-2.4% [-2.8%, -1.5%] 5
All ❌✅ (primary) 0.7% [-1.4%, 2.7%] 2

Binary size

Results (primary 1.1%)

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

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

Bootstrap: 688.989s -> 689.147s (0.02%)
Artifact size: 371.96 MiB -> 372.00 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 24, 2025
@JonathanBrouwer JonathanBrouwer force-pushed the rustc_attributes_parser branch from 49398cf to 37abd08 Compare June 24, 2025 08:33
@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Jun 24, 2025

^ I've boxed the u128, since there seems to be a performance regression.
Let's see if I have permission to undo the changes made by rust-timer
@bors rollup=always (since it should no longer be perf-sensitive)
@rustbot label: -perf-regression

@rustbot rustbot removed the perf-regression Performance regression. label Jun 24, 2025
@bors
Copy link
Collaborator

bors commented Jun 24, 2025

@JonathanBrouwer: 🔑 Insufficient privileges: not in try users

@jdonszelmann
Copy link
Contributor

No let's not rollup always, still want to see the final results

@bors
Copy link
Collaborator

bors commented Jun 24, 2025

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

@JonathanBrouwer JonathanBrouwer force-pushed the rustc_attributes_parser branch from 37abd08 to e6396e3 Compare June 24, 2025 15:12
@jdonszelmann
Copy link
Contributor

@rustbot author

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

rustbot commented Jun 24, 2025

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

…ute parsing infrastructure

Signed-off-by: Jonathan Brouwer <[email protected]>
@JonathanBrouwer JonathanBrouwer force-pushed the rustc_attributes_parser branch from e6396e3 to d5586dc Compare June 25, 2025 07:44
@JonathanBrouwer
Copy link
Contributor Author

^ Rebased & replied to your comment
@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 25, 2025
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-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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants