Skip to content
Prev Previous commit
Next Next commit
Add some comments.
  • Loading branch information
nnethercote committed Nov 22, 2023
commit 9fe6bb4a10a51073c01d501a9734efb9e818adad
5 changes: 5 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! AST pretty printing.
//!
//! Note that HIR pretty printing is layered on top of this crate.

mod expr;
mod item;

Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_hir_pretty/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down