File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 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 is 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
424mod auto_trait;
525mod blanket_impl;
You can’t perform that action at this time.
0 commit comments