Crate rustc_hir_pretty

Source
Expand description

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.

Structs§

State

Enums§

AnnNode
Nested

Constants§

INDENT_UNIT 🔒

Traits§

PpAnn

Functions§

attribute_to_string
contains_exterior_struct_lit 🔒
Expressions that syntactically contain an “exterior” struct literal, i.e., not surrounded by any parens or other delimiters, e.g., X { y: 1 }, X { y: 1 }.method(), foo == X { y: 1 } and X { y: 1 } == foo all do, but (X { y: 1 }) == foo does not.
expr_requires_semi_to_be_stmt 🔒
Does this expression require a semicolon to be treated as a statement? The negation of this: ‘can this expression be used as a statement without a semicolon’ – is used as an early-bail-out in the parser so that, for instance, if true {…} else {…} |x| 5 isn’t parsed as (if true {…} else {…} | x) | 5
expr_to_string
id_to_string
pat_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.
qpath_to_string
stmt_ends_with_semi 🔒
This statement requires a semicolon after it. note that in one case (stmt_semi), we’ve already seen the semicolon, and thus don’t need another.
to_string 🔒
ty_to_string