[][src]Crate syntax

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The Rust parser and macro expander.

Note

This API is completely unstable and subject to change.

Re-exports

pub use errors;

Modules

astInternal

The Rust abstract syntax tree module.

attrInternal

Functions dealing with attributes and meta items.

diagnosticsInternal
early_buffered_lintsInternal

Allows the buffering of lints for later.

editionInternal
entryInternal
expandInternal

Definitions shared by macros / syntax extensions and e.g. librustc.

feature_gateInternal
mut_visitInternal

A MutVisitor represents an AST modification; it accepts an AST piece and and mutates it in place. So, for instance, macro expansion is a MutVisitor that walks over an AST and modifies it.

printInternal
ptrInternal

The AST pointer.

sessInternal

Contains ParseSess which holds state living beyond what one Parser might. It also serves as an input to the parser itself.

show_spanInternal

Span debugger

source_mapInternal

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.

symbolInternal

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.

tokenInternal
tokenstreamInternal

Token Streams

utilInternal
visitInternal

AST walker. Each overridden visit method has full control over what happens with its node, it can do its own traversal of the node's children, call visit::walk_* to apply the default traversal algorithm, or prevent deeper traversal by doing nothing.

Macros

diagnostic_usedInternal
helpInternal
span_errInternal
span_err_or_warnInternal
span_fatalInternal
span_helpInternal
span_noteInternal
span_warnInternal
stringify_error_codeInternal
struct_errInternal
struct_span_errInternal
struct_span_err_or_warnInternal
struct_span_fatalInternal
struct_span_warnInternal
type_error_structInternal
unwrap_orInternal
walk_listInternal

Structs

GlobalsInternal
ThinVecInternal

A vector type optimized for cases where this size is usually 0 (cf. SmallVector). The Option<Box<..>> wrapping allows us to represent a zero sized vector with None, which uses only a single (null) pointer.

Statics

GLOBALSInternal

Traits

HashStableContextInternal

Requirements for a StableHashingContext to be used in this crate. This is a hack to allow using the HashStable_Generic derive macro instead of implementing everything in librustc.

Functions

with_default_globalsInternal
with_globalsInternal