Skip to content

Commit a5a1775

Browse files
committed
rustdoc: update module-level docs of rustdoc::clean
1 parent 7bdae13 commit a5a1775

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/librustdoc/clean/mod.rs

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
//! This module contains the "cleaned" pieces of the AST, and the functions
2-
//! that clean them.
1+
//! This module defines the primary IR[^1] used in rustdoc together with the procedures that
2+
//! transform rustc data types into it.
3+
//!
4+
//! This IR — commonly referred to as the *cleaned AST* — is modeled after the [AST][ast].
5+
//!
6+
//! There are two kinds of transformation — *cleaning* — procedures:
7+
//!
8+
//! 1. Cleans [HIR][hir] types. Used for user-written code and inlined local re-exports
9+
//! both found in the local crate.
10+
//! 2. Cleans [`rustc_middle::ty`] types. Used for inlined cross-crate re-exports and anything
11+
//! output by the trait solver (e.g., when synthesizing blanket and auto-trait impls).
12+
//! They usually have `ty` or `middle` in their name.
13+
//!
14+
//! Their name is prefixed by `clean_`.
15+
//!
16+
//! Both the HIR and the `rustc_middle::ty` IR are quite removed from the source code.
17+
//! The cleaned AST on the other hand is closer to it which simplifies the rendering process.
18+
//! Furthermore, operating on a single IR instead of two avoids duplicating efforts down the line.
19+
//!
20+
//! This IR is consumed by both the HTML and the JSON backend.
21+
//!
22+
//! [^1]: Intermediate representation.
323
424
mod auto_trait;
525
mod blanket_impl;

0 commit comments

Comments
 (0)