Module rustc_save_analysis::source_map[−][src]

Expand description

Types for tracking pieces of source code within a crate.

The SourceMap tracks all the source code used within a single crate, mapping from integer byte positions to the original source code location. Each bit of source parsed during crate parsing (typically files, in-memory strings, or various bits of macro expansion) cover a continuous range of bytes in the SourceMap and are represented by SourceFiles. Byte positions are stored in Span and used pervasively in the compiler. They are absolute positions within the SourceMap, which upon request can be converted to line and column information, source code snippets, etc.

Modules

Machinery for hygienic macros.

Levenshtein distances.

An “interner” is a data structure that associates values with usize tags and allows bidirectional lookup; i.e., given a value, one can easily find the type, and vice versa.

Structs

A byte offset.

A character offset.

A subset of properties from both macro definition and macro call available through global data. Avoid using this if you have access to the original definition or call structures.

A unique hash value associated to an expansion.

A unique ID associated with a macro invocation and expansion.

Range inside of a Span used for diagnostics when we only have access to relative positions.

A source code location used for error reporting.

A unique ID associated with a macro invocation and expansion.

Identifies an offset of a multi-byte character in a SourceFile.

A collection of Spans.

Identifies an offset of a character that was normalized away from SourceFile.

A FileLoader that uses std::fs to load real files.

A single source in the SourceMap.

The hash of the on-disk source file used for debug info.

A compressed span.

Represents a span.

A span together with some additional data.

This is a SourceFile identifier that is used to correlate source files between subsequent compilation sessions (which is something we need to do during incremental compilation).

An interned string.

A SyntaxContext represents a chain of pairs (ExpnId, Transparency) named “marks”.

Enums

The kind of compiler desugaring.

Expansion kind.

The state of the lazy external source loading mechanism of a SourceFile.

Differentiates between real files and common virtual files.

The kind of macro invocation or definition.

Identifies an offset of a non-narrow character in a SourceFile.

Constants

Dummy span, both position and length are zero, syntax context is zero as well.

Statics

Traits

An abstraction over the fs operations used by the Parser.

Requirements for a StableHashingContext to be used in this crate.

Functions

Returns the span itself if it doesn’t come from a macro expansion, otherwise return the call site span up to the enclosing_sp by following the expn_data chain.

Calls the provided closure, using the provided SourceMap to format any spans that are debug-printed during the closure’s execution.

Type Definitions