[][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
attrInternal

Functions dealing with attributes and meta items

configInternal
diagnosticsInternal
early_buffered_lintsInternal

Allows the buffering of lints for later.

editionInternal
entryInternal
error_codesInternal
extInternal
feature_gateInternal

Feature gating

jsonInternal

A JSON emitter for errors.

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.

parseInternal

The main parser interface.

printInternal
ptrInternal

The AST pointer.

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 spans 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.

std_injectInternal
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.

syntaxInternal
testInternal
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

helpInternal
register_diagnosticInternal
register_diagnosticsInternal
register_long_diagnosticsInternal
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.

Constants

DIAGNOSTICSInternal
MACRO_ARGUMENTSInternal

Statics

GLOBALSInternal

Functions

with_default_globalsInternal
with_globalsInternal