Crate rustc_span

source ·
Expand description

Source positions and related helper functions.

Important concepts in this module include:

  • the span, represented by SpanData and related types;
  • source code as represented by a SourceMap; and
  • interned strings, represented by Symbols, with some common symbols available statically in the sym module.

Unlike most compilers, the span contains not only the position in the source code, but also various other metadata, such as the edition and macro hygiene. This metadata is stored in SyntaxContext and ExpnData.

§Note

This API is completely unstable and subject to change.

Re-exports§

Modules§

Macros§

Structs§

Enums§

Constants§

  • The dummy span has zero position, length, and context, and no parent.

Statics§

Traits§

  • Requirements for a StableHashingContext to be used in this crate.
  • This trait is used to allow decoder specific encodings of certain types. It is similar to rustc_type_ir’s TyDecoder.
  • This trait is used to allow encoder specific encodings of certain types. It is similar to rustc_type_ir’s TyEncoder.

Functions§

Type Aliases§