Force us to name impls with just the filename/line number. We
normally try to use types. But at some points, notably while printing
cycle errors, this can result in extra or suboptimal error output,
so this variable disables that check.
Prevent path trimming if it is turned on. Path trimming affects Display impl
of various rustc types, for example std::vec::Vec would be trimmed to Vec,
if no other Vec is found.
Avoids running select queries during any prints that occur
during the closure. This may alter the appearance of some
types (e.g. forcing verbose printing for opaque types).
This method is used during some queries (e.g. explicit_item_bounds
for opaque types), to ensure that any debug printing that
occurs during the query computation does not end up recursively
calling the same query.
The “region highlights” are used to control region printing during
specific error messages. When a “region highlight” is enabled, it
gives an alternate way to print specific regions. For now, we
always print those regions using a number, so something like “'0”.
A trait that “prints” user-facing type system entities: paths, types, lifetimes, constants,
etc. “Printing” here means building up a representation of the entity’s path, usually as a
String (e.g. “std::io::Read”) or a Vec<Symbol> (e.g. [sym::std, sym::io, sym::Read]). The
representation is built up by appending one or more pieces. The specific details included in
the built-up representation depend on the purpose of the printer. The more advanced printers
also rely on the PrettyPrinter sub-trait.
As a heuristic, when we see an impl, if we see that the
‘self type’ is a type defined in the same module as the impl,
we can omit including the path to the impl itself. This
function tries to find a “characteristic DefId” for a
type. It’s just a heuristic so it makes some questionable
decisions and we may want to adjust it later.
The purpose of this function is to collect public symbols names that are unique across all
crates in the build. Later, when printing about types we can use those names instead of the
full exported path to them.