-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_attr_data_structures |
ff9276d
to
1cf957f
Compare
There was a problem hiding this 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.
1cf957f
to
b867d3e
Compare
There was a problem hiding this 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 author |
Reminder, once the PR becomes ready for a review, use |
b867d3e
to
c269af8
Compare
@rustbot ready |
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) |
Seems to not conflict with #138164, let me rebase it. |
c269af8
to
4ef6670
Compare
@@ -1,3 +1,35 @@ | |||
//! Data structures for representing parsed attributes in the Rust compiler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once more, I won't merge this documentation here. Only a link to rustc_attr_parsing
is all that's needed so we don't have to keep two sets of docs up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rustbot author
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
4ef6670
to
be82bad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rustbot ready
@@ -1,3 +1,30 @@ | |||
//! 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that a link is added at the top of rustc_attr_data_structures
, but the rest of the content is retained because the rest of the content points to the structures in rustc_attr_data_structures
. Is that correct?
Or do I have to move all the documentation at the top of rustc_attr_data_structures/src/lib.rs
into rustc_attr_parsing
, and then just keep a link?
I may not have been too clear on whether it was the former or the latter. My understanding is the former, since the two crates have different responsibilities. And in my previous version, I mixed up part of the parsed documentation in rustc_attr_data_structures
, so add a copy of the link.
I was reading through
AttributeKind
and realized that attributes likeInlineAttr
didn't appear in it, however, I found them inrustc_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 incodegen_ssa
, such asInlineAttr
,OptimizeAttr
,InstructionSetAttr
.Also, I've added documentation for
AttributeKind
that further explains why attributes likeInlineAttr
don't appear in it, with examples for each variant.r? @jdonszelmann