Skip to content

Refactor rustc_attr_data_structures documentation #142082

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

xizheyin
Copy link
Contributor

@xizheyin xizheyin commented Jun 5, 2025

I was reading through AttributeKind and realized that attributes like InlineAttr didn't appear in it, however, I found them in rustc_codegen_ssa and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of lib.rs, and I've grouped the Attributes into two categories: AttributeKind that run all through the compiler, and the ones that are only used in codegen_ssa, such as InlineAttr, OptimizeAttr, InstructionSetAttr.

Also, I've added documentation for AttributeKind that further explains why attributes like InlineAttr don't appear in it, with examples for each variant.

r? @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 Jun 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 5, 2025

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

@xizheyin xizheyin force-pushed the rustc_attr_data_structures branch from ff9276d to 1cf957f Compare June 5, 2025 14:16
Copy link
Contributor

@jdonszelmann jdonszelmann left a comment

Choose a reason for hiding this comment

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

As per my previous comments, won't approve this PR for the time being despite it having some good changes.

@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 6, 2025
@xizheyin xizheyin force-pushed the rustc_attr_data_structures branch from 1cf957f to b867d3e Compare June 6, 2025 14:10
Copy link
Contributor Author

@xizheyin xizheyin left a comment

Choose a reason for hiding this comment

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

I also remove the comments in variants of AttributeKind.
@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 6, 2025
@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 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2025

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

@xizheyin xizheyin force-pushed the rustc_attr_data_structures branch from b867d3e to c269af8 Compare June 12, 2025 11:30
@xizheyin
Copy link
Contributor Author

@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 12, 2025
@jdonszelmann
Copy link
Contributor

likely to conflict (minorly) with #138164, let's wait for that to merge (or preemptively rebase ontop of it). It's in the queue, judging by the state of which it'll take an hour or 8 for that to get through. Will look again tonight (european time)

@xizheyin
Copy link
Contributor Author

xizheyin commented Jun 13, 2025

Seems to not conflict with #138164, let me rebase it.

@xizheyin xizheyin force-pushed the rustc_attr_data_structures branch from c269af8 to 4ef6670 Compare June 13, 2025 05:24
@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 13, 2025
@xizheyin xizheyin force-pushed the rustc_attr_data_structures branch from 88e5e54 to 1ac89f1 Compare June 15, 2025 12:04
Copy link
Contributor Author

@xizheyin xizheyin left a comment

Choose a reason for hiding this comment

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

@rustbot ready

Comment on lines +1 to +4
//! Data structures for representing parsed attributes in the Rust compiler.
//! For detailed documentation about attribute processing,
//! see [rustc_attr_parsing](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_parsing/index.html).

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 remove all of other docs.

@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 15, 2025
@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 15, 2025

📌 Commit 1ac89f1 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2025
@jdonszelmann
Copy link
Contributor

@bors r- oh let's wait for CI, a bit too enthusiastic

@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 15, 2025
@xizheyin
Copy link
Contributor Author

haha, all the checks passed.

@jdonszelmann
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 15, 2025

📌 Commit 1ac89f1 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 15, 2025
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 16, 2025
…s, r=jdonszelmann

Refactor `rustc_attr_data_structures` documentation

I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`.

Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant.

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

Successful merges:

 - #138237 (Get rid of `EscapeDebugInner`.)
 - #140809 (Reduce special casing for the panic runtime)
 - #141990 (Implement send_signal for unix child processes)
 - #142082 (Refactor `rustc_attr_data_structures` documentation)
 - #142125 (Stabilize "file_lock" feature)
 - #142528 (clarify `rustc_do_not_const_check` comment)
 - #142530 (use `if let` guards where possible)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 16, 2025
…s, r=jdonszelmann

Refactor `rustc_attr_data_structures` documentation

I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`.

Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant.

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

Successful merges:

 - #140809 (Reduce special casing for the panic runtime)
 - #142082 (Refactor `rustc_attr_data_structures` documentation)
 - #142125 (Stabilize "file_lock" feature)
 - #142373 (Fix Debug for Location)
 - #142414 (ignore `run-make` tests that need `std` on targets without `std`)
 - #142416 (Assorted bootstrap cleanups (step 2))
 - #142431 (Add initial version of snapshot tests to bootstrap)
 - #142528 (clarify `rustc_do_not_const_check` comment)

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

Successful merges:

 - #141639 (Expose discriminant values in stable_mir)
 - #142082 (Refactor `rustc_attr_data_structures` documentation)
 - #142125 (Stabilize "file_lock" feature)
 - #142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - #142373 (Fix Debug for Location)
 - #142416 (Assorted bootstrap cleanups (step 2))
 - #142431 (Add initial version of snapshot tests to bootstrap)
 - #142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - #142528 (clarify `rustc_do_not_const_check` comment)
 - #142530 (use `if let` guards where possible)
 - #142561 (Remove an `njn:` comment accidentaly left behind.)
 - #142566 (Fix `-nopt` CI jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3795658 into rust-lang:master Jun 16, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 16, 2025
rust-timer added a commit that referenced this pull request Jun 16, 2025
Rollup merge of #142082 - xizheyin:rustc_attr_data_structures, r=jdonszelmann

Refactor `rustc_attr_data_structures` documentation

I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`.

Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant.

r? ```@jdonszelmann```
compiler-errors pushed a commit to compiler-errors/rust that referenced this pull request Jun 16, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#141639 (Expose discriminant values in stable_mir)
 - rust-lang#142082 (Refactor `rustc_attr_data_structures` documentation)
 - rust-lang#142125 (Stabilize "file_lock" feature)
 - rust-lang#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - rust-lang#142373 (Fix Debug for Location)
 - rust-lang#142416 (Assorted bootstrap cleanups (step 2))
 - rust-lang#142431 (Add initial version of snapshot tests to bootstrap)
 - rust-lang#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - rust-lang#142528 (clarify `rustc_do_not_const_check` comment)
 - rust-lang#142530 (use `if let` guards where possible)
 - rust-lang#142561 (Remove an `njn:` comment accidentaly left behind.)
 - rust-lang#142566 (Fix `-nopt` CI jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 17, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#141639 (Expose discriminant values in stable_mir)
 - rust-lang/rust#142082 (Refactor `rustc_attr_data_structures` documentation)
 - rust-lang/rust#142125 (Stabilize "file_lock" feature)
 - rust-lang/rust#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - rust-lang/rust#142373 (Fix Debug for Location)
 - rust-lang/rust#142416 (Assorted bootstrap cleanups (step 2))
 - rust-lang/rust#142431 (Add initial version of snapshot tests to bootstrap)
 - rust-lang/rust#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - rust-lang/rust#142528 (clarify `rustc_do_not_const_check` comment)
 - rust-lang/rust#142530 (use `if let` guards where possible)
 - rust-lang/rust#142561 (Remove an `njn:` comment accidentaly left behind.)
 - rust-lang/rust#142566 (Fix `-nopt` CI jobs)

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.

4 participants