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
@@ -85,7 +85,7 @@ hir-stats FnDecl 120 (NN.N%) 3 40
hir-stats FieldDef 128 (NN.N%) 2 64
hir-stats GenericArgs 144 (NN.N%) 3 48
hir-stats Variant 144 (NN.N%) 2 72
hir-stats Attribute 160 (NN.N%) 4 40
hir-stats Attribute 192 (NN.N%) 4 48
Copy link
Contributor Author

@JonathanBrouwer JonathanBrouwer Jun 23, 2025

Choose a reason for hiding this comment

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

This is because the new attribute has both a u128 and a span . Is this a problem? If so I can box the u128

Copy link
Member

Choose a reason for hiding this comment

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

I've kicked off a perf-run, let's see what happens.

Copy link
Contributor

Choose a reason for hiding this comment

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

Attributes aren't that common, so it's not too important. Having said that, it looks like boxing the u128s would be really easy, so it's probably worth doing that.

@@ -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?

…ute parsing infrastructure

Signed-off-by: Jonathan Brouwer <[email protected]>
@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
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@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
Copy link
Collaborator

Queued 600a41a with parent 706f244, future comparison URL.
There are currently 5 preceding artifacts in the queue.
It will probably take at least ~7.6 hours until the benchmark run finishes.

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
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-perf Status: Waiting on a perf run to be completed. 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.

6 participants