diff options
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index f29e8b54681..8f6217379a4 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1,3 +1,7 @@ +//! AST pretty printing. +//! +//! Note that HIR pretty printing is layered on top of this crate. + mod expr; mod item; @@ -256,6 +260,7 @@ impl std::ops::DerefMut for State<'_> { } } +/// This trait is used for both AST and HIR pretty-printing. pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::DerefMut { fn comments(&mut self) -> &mut Option<Comments<'a>>; fn ann_post(&mut self, ident: Ident); diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index a1a218a421b..9f7d7f989e3 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -1,3 +1,6 @@ +//! HIR pretty-printing is layered on top of AST pretty-printing. A number of +//! the definitions in this file have equivalents in `rustc_ast_pretty`. + #![recursion_limit = "256"] #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] |
