-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Clean rustc_attr_parsing/src/lib.rs
documentation
#142058
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
Conversation
Some changes occurred in compiler/rustc_attr_parsing |
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.
Lovely, got a small comment but looks good on the whole @rustbot author
//! - rustc_attr_parsing: this crate | ||
//! - (in the future): rustc_attr_validation | ||
//! This crate is part of a series of crates that handle attribute processing: | ||
//! - rustc_attr_data_structures: Defines the data structures that store parsed attributes |
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.
Could you point out why there's a split between parsing and data structures?
Reminder, once the PR becomes ready for a review, use |
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.
Thanks for review!
@rustbot ready
//! The separation between data structures and parsing follows the principle of separation of concerns. | ||
//! Data structures (`rustc_attr_data_structures`) define what attributes look like after parsing. | ||
//! This crate (`rustc_attr_parsing`) handles how to convert raw tokens into those structures. | ||
//! This split allows other parts of the compiler to use the data structures without needing | ||
//! the parsing logic, making the codebase more modular and maintainable. |
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 added the explanation in a new commit (not sure if it's right, wrote it intuitively) and opened a new section Architecture
.
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.
Almost, the important part is that we can't have crate cycles. rustc_hir stores attributes, so has to depend on rustc_attr_data_structures. However, rustc_attr_parsing has to depend on rustc_hir, so if data structures was the same crate as parsing, there would be a cycle.
An additional commit to fix typo in |
could you squash them together? |
@rustbot author |
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
de36336
to
1e49ad3
Compare
I see! no worries, I'm the person actively working on this refactor so feel free to ask my review for work around here with r? @jdonszelmann whenever you need it. @bors r+ rollup |
This comment was marked as resolved.
This comment was marked as resolved.
…nszelmann Clean `rustc_attr_parsing/src/lib.rs` documentation Improves the documentation clarity in `rustc_attr_parsing` by restructuring content with clearer section headers, simplifying explanations of attribute types, making technical descriptions more precise. r? `@oli-obk`
Rollup of 11 pull requests Successful merges: - #125087 (Optimize `Seek::stream_len` impl for `File`) - #141982 (`tests/ui`: A New Order [5/N]) - #142012 (Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None) - #142044 (compiler: Document the offset invariant of `OperandValue::Pair`) - #142047 (Ensure stack in two places that affect s390x) - #142058 (Clean `rustc_attr_parsing/src/lib.rs` documentation) - #142067 (canon_abi: make to_erased_extern_abi just a detail in formatting) - #142072 (doc: Fix inverted meaning in E0783.md) - #142084 (add myself to rotation) - #142091 (Fix AIX build) - #142092 (rustdoc: Support middle::ty associated const equality predicates again) Failed merges: - #142042 (Make E0621 missing lifetime suggestion verbose) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - #125087 (Optimize `Seek::stream_len` impl for `File`) - #141982 (`tests/ui`: A New Order [5/N]) - #142012 (Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None) - #142044 (compiler: Document the offset invariant of `OperandValue::Pair`) - #142047 (Ensure stack in two places that affect s390x) - #142058 (Clean `rustc_attr_parsing/src/lib.rs` documentation) - #142067 (canon_abi: make to_erased_extern_abi just a detail in formatting) - #142072 (doc: Fix inverted meaning in E0783.md) - #142084 (add myself to rotation) - #142091 (Fix AIX build) - #142092 (rustdoc: Support middle::ty associated const equality predicates again) Failed merges: - #142042 (Make E0621 missing lifetime suggestion verbose) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - #125087 (Optimize `Seek::stream_len` impl for `File`) - #141982 (`tests/ui`: A New Order [5/N]) - #142012 (Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None) - #142044 (compiler: Document the offset invariant of `OperandValue::Pair`) - #142047 (Ensure stack in two places that affect s390x) - #142058 (Clean `rustc_attr_parsing/src/lib.rs` documentation) - #142067 (canon_abi: make to_erased_extern_abi just a detail in formatting) - #142072 (doc: Fix inverted meaning in E0783.md) - #142084 (add myself to rotation) - #142091 (Fix AIX build) - #142092 (rustdoc: Support middle::ty associated const equality predicates again) Failed merges: - #142042 (Make E0621 missing lifetime suggestion verbose) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142058 - xizheyin:rustc-attr-parsing, r=jdonszelmann Clean `rustc_attr_parsing/src/lib.rs` documentation Improves the documentation clarity in `rustc_attr_parsing` by restructuring content with clearer section headers, simplifying explanations of attribute types, making technical descriptions more precise. r? ``@oli-obk``
Improves the documentation clarity in
rustc_attr_parsing
by restructuring content with clearer section headers, simplifying explanations of attribute types, making technical descriptions more precise.r? @oli-obk