Module pretty

Module pretty 

Source

StructsΒ§

ExtraComments πŸ”’
MirDumper
Manages MIR dumping, which is MIR writing done to a file with a specific name. In particular, it makes it impossible to dump MIR to one of these files when it hasn’t been requested from the command line. Layered on top of MirWriter, which does the actual writing.
MirWriter
Does the writing of MIR to output, e.g. a file.
PrettyPrintMirOptions
Cosmetic options for pretty-printing the MIR contents, gathered from the CLI. Each pass can override these when dumping its own specific MIR information with dump_mir.

EnumsΒ§

PassWhere
An indication of where we are in the control flow graph. Used for printing extra information in dump_mir

ConstantsΒ§

ALIGN πŸ”’
Alignment for lining up comments following MIR statements
BYTES_PER_LINE πŸ”’
Number of bytes to print per allocation hex dump line.
INDENT πŸ”’

FunctionsΒ§

comma_sep πŸ”’
comment πŸ”’
display_allocation
Dumps the size and metadata and content of an allocation to the given writer. The expectation is that the caller first prints other relevant metadata, so the exact format of this function is (without leading or trailing newline):
dump_mir_def_ids
hex_number_length πŸ”’
Calc converted u64 decimal into hex and return its length in chars.
post_fmt_projection πŸ”’
pre_fmt_projection πŸ”’
pretty_print_byte_str πŸ”’
pretty_print_const_value πŸ”’
pretty_print_const_value_tcx πŸ”’
use_verbose πŸ”’
write_allocation_bytes
The prefix argument allows callers to add an arbitrary prefix before each line (even if there is only one line). Note that your prefix should contain a trailing space as the lines are printed directly after it.
write_allocation_endline πŸ”’
write_allocation_newline πŸ”’
Prints the line start address and returns the new line start address.
write_allocations
Find all AllocIds mentioned (recursively) in the MIR body and print their corresponding allocations.
write_coverage_info_hi πŸ”’
write_extra πŸ”’
After we print the main statement, we sometimes dump extra information. There’s often a lot of little things β€œnuzzled up” in a statement.
write_function_coverage_info πŸ”’
write_mir_intro πŸ”’
Write out a human-readable textual representation of the MIR’s fn type and the types of its local variables (both user-defined bindings and compiler temporaries).
write_mir_pretty
Write out a human-readable textual representation for the given MIR, with the default PrettyPrintMirOptions.
write_mir_sig πŸ”’
write_scope_tree πŸ”’
Prints local variables in a scope tree.
write_user_type_annotations πŸ”’