Skip to main content

Module state

Module state 

Source
Expand description

AST pretty printing.

Note that HIR pretty printing is layered on top of this crate.

Re-exportsยง

use std::borrow::Cow; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use rustc_ast::attr::AttrIdGenerator; ๐Ÿ”’
use rustc_ast::tokenstream::Spacing; ๐Ÿ”’
use rustc_ast::tokenstream::TokenStream; ๐Ÿ”’
use rustc_ast::tokenstream::TokenTree; ๐Ÿ”’
use rustc_ast::util::classify; ๐Ÿ”’
use rustc_ast::util::comments::Comment; ๐Ÿ”’
use rustc_ast::util::comments::CommentStyle; ๐Ÿ”’
use rustc_ast as ast; ๐Ÿ”’
use rustc_ast::AttrArgs; ๐Ÿ”’
use rustc_ast::AttrKind; ๐Ÿ”’
use rustc_ast::BindingMode; ๐Ÿ”’
use rustc_ast::BlockCheckMode; ๐Ÿ”’
use rustc_ast::ByRef; ๐Ÿ”’
use rustc_ast::DelimArgs; ๐Ÿ”’
use rustc_ast::GenericArg; ๐Ÿ”’
use rustc_ast::GenericBound; ๐Ÿ”’
use rustc_ast::InlineAsmOperand; ๐Ÿ”’
use rustc_ast::InlineAsmOptions; ๐Ÿ”’
use rustc_ast::InlineAsmRegOrRegClass; ๐Ÿ”’
use rustc_ast::InlineAsmTemplatePiece; ๐Ÿ”’
use rustc_ast::PatKind; ๐Ÿ”’
use rustc_ast::RangeEnd; ๐Ÿ”’
use rustc_ast::RangeSyntax; ๐Ÿ”’
use rustc_ast::SelfKind; ๐Ÿ”’
use rustc_ast::Term; ๐Ÿ”’
use rustc_ast::attr; ๐Ÿ”’
use rustc_ast::token as tk; ๐Ÿ”’
use rustc_span::edition::Edition; ๐Ÿ”’
use rustc_span::source_map::SourceMap; ๐Ÿ”’
use rustc_span::symbol::IdentPrinter; ๐Ÿ”’
use rustc_span::BytePos; ๐Ÿ”’
use rustc_span::CharPos; ๐Ÿ”’
use rustc_span::DUMMY_SP; ๐Ÿ”’
use rustc_span::FileName; ๐Ÿ”’
use rustc_span::Ident; ๐Ÿ”’
use rustc_span::Pos; ๐Ÿ”’
use rustc_span::Span; ๐Ÿ”’
use rustc_span::Spanned; ๐Ÿ”’
use rustc_span::Symbol; ๐Ÿ”’
use rustc_span::kw; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use crate::pp::Breaks::Consistent; ๐Ÿ”’
use crate::pp::Breaks::Inconsistent; ๐Ÿ”’
use crate::pp; ๐Ÿ”’
use crate::pp::BoxMarker; ๐Ÿ”’
use crate::pp::Breaks; ๐Ÿ”’
use crate::pprust::state::fixup::FixupContext; ๐Ÿ”’

Modulesยง

expr ๐Ÿ”’
fixup ๐Ÿ”’
item ๐Ÿ”’

Structsยง

Comments
NoAnn ๐Ÿ”’
State

Enumsยง

AnnNode
MacHeader

Constantsยง

INDENT_UNIT ๐Ÿ”’

Traitsยง

PpAnn
PrintState
This trait is used for both AST and HIR pretty-printing.

Functionsยง

all_whitespace ๐Ÿ”’
Returns None if the first col chars of s contain a non-whitespace char. Otherwise returns Some(k) where k is first char offset after that leading whitespace. Note that k may be outside bounds of s.
doc_comment_to_string
gather_comments ๐Ÿ”’
idents_would_merge ๐Ÿ”’
Should two consecutive tokens be printed with a space between them?
literal_to_string ๐Ÿ”’
print_crate
Requires you to pass an input filename and reader so that it can scan the input text for comments to copy forward.
print_crate_as_interface
print_crate_inner ๐Ÿ”’
space_between ๐Ÿ”’
split_block_comment_into_lines ๐Ÿ”’
trim_whitespace_prefix ๐Ÿ”’