You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/rustc_attr_parsing/src/lib.rs
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,17 @@
1
1
//! Centralized logic for parsing and attributes.
2
2
//!
3
-
//! This crate is part of a series of crates that handle attribute processing:
4
-
//! - rustc_attr_data_structures: Defines the data structures that store parsed attributes
5
-
//! - rustc_attr_parsing: This crate, handles the parsing of attributes
3
+
//! ## Architecture
4
+
//! This crate is part of a series of crates that handle attribute processing.
5
+
//! - [rustc_attr_data_structures](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_data_structures/index.html): Defines the data structures that store parsed attributes
6
+
//! - [rustc_attr_parsing](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_parsing/index.html): This crate, handles the parsing of attributes
6
7
//! - (planned) rustc_attr_validation: Will handle attribute validation
7
8
//!
9
+
//! The separation between data structures and parsing follows the principle of separation of concerns.
10
+
//! Data structures (`rustc_attr_data_structures`) define what attributes look like after parsing.
11
+
//! This crate (`rustc_attr_parsing`) handles how to convert raw tokens into those structures.
12
+
//! This split allows other parts of the compiler to use the data structures without needing
13
+
//! the parsing logic, making the codebase more modular and maintainable.
14
+
//!
8
15
//! ## Background
9
16
//! Previously, the compiler had a single attribute definition (`ast::Attribute`) with parsing and
10
17
//! validation scattered throughout the codebase. This was reorganized for better maintainability
0 commit comments