types

Architecture snapshot · search, inspect, and follow dependenciesOpen full-page explorer ↗
Chapter contents

Name

Interned spelling, not definition identity.

Scope

Enclosing local module or crate scope.

Owner

Optional trait or impl owner of an associated definition.

Syntax

Self-contained item CST, including source-relative spans.

Span

AbsoluteSpan: a byte range in one parseable source. {anchor}`spans.relative_composition` A source-root item owns an absolute span in one ParseSource. A nested definition is placed relative to its immediate represented owner, and its signature CST, body CST, and typed-body nodes use offsets relative to that definition's own start. Resolving a nested node composes every intervening relative range with the source-root absolute range.

RelativeSpan

A byte range measured from the immediate represented owner. {anchor}`spans.item_origin` The parser measures each item from the earliest of its first attribute and item-node start, so attribute offsets are nonnegative. Entering an associated item establishes a new item-relative base rather than retaining the enclosing trait or impl base. {anchor}`spans.offset_reuse` An edit outside an item which only moves its absolute range may update diagnostics and position lookup, but leaves relative CST and typed content equal and must not propagate into semantic consumers which did not read the absolute coordinate.

ParseSource

Real source and generated text have distinct provenance. Generated coordinates address generated text, not origin text.

SourceFile

A source-file input with path and text; storage and database lifetimes are omitted.

MacroDefSymbol

Kind-specific local or external macro-definition identity.

DeriveExpansion

One derive occurrence on a stable source item. Its current origin span and generated text are separately available facts. {anchor}`spans.generated_identity` Each generated parse source is identified by stable source input, generating operation, and occurrence, while generated text and current origin coordinates are mutable facts. Moving the origin must not collapse distinct occurrences or mint a replacement source identity.

Signature

Review-only sum for grouped checking and metadata operations. Rust exposes these results separately; this enum is not a Rust runtime representation.

Items

Review wrapper for ordered module/variant symbol lists; membership does not imply expansion completeness.

Value

Checked associated value or field/member representation.

Resolution

Resolved symbol, ambiguity, failure, or incomplete lookup.

Environment

Generic parameters, Self, assumptions, and lexical bindings.

InferenceState

Body-local variables, versioned constraints, obligations, tasks, and diagnostics.

Goal

Canonical proof or normalization question and its environment.

Answer

Canonical solver response, including uncertainty and resource limits.

Candidates

Candidate set with completeness evidence.

Metadata

Owned keyed facts supplied by an external provider.

Unit

No semantic result.

Source

Source text or generated-token source with provenance.

Identity

External crate and definition indices, or a scoped identity.

Boolean

Boolean flag.

Edition

Rust edition controlling syntax and resolution.

OptionalScope

Optional parent scope; absent for the root module.

Binder

A value of T together with the generic parameters binding its references. Parameters have stable identities; opening an owner's binder reuses those identities before introducing an associated item's own parameters. {anchor}`binder.owner_parameters` Opening an associated signature reuses the owning trait or impl's Self and generic parameter identities before introducing the associated item's own parameters. A Binder pairs its value with the parameters binding references in that value; copying or opening it does not mint replacements for those identities.

Ty

A resolved Rust type. Recursive children are semantic values; storage is omitted.

IntTy

UintTy

FloatTy

Mutability

Lifetime

Meaningful lifetime reasoning is not implemented in the current compiler. {anchor}`lifetimes.dummy` Every explicit, elided, universal, existential, imported, and synthesized lifetime lowers to Dummy. Dummy is neither static, a lifetime inference variable, nor post-analysis region erasure, and this deliberate omission does not create ambiguity. {anchor}`lifetimes.unchecked_borrows` Outlives(Dummy, Dummy) holds. Reference and dereference operations remain explicit because they affect ordinary types, while Sage does not check borrow liveness, uniqueness, overlap, or validity.

Const

AliasTy

Alias identity is retained until normalization is explicitly requested. {anchor}`aliases.identity` Named, associated, and opaque aliases retain their definition identity and generic arguments as one semantic type family across copy, fold, display, inference, canonical queries/responses, and oracle emission. A debug-formatted string is not a semantic rigid or alias type. {anchor}`aliases.revelation` Normalization is explicit. Completed IR need not erase every alias: named aliases reveal their substituted right-hand sides, associated projections normalize through trait solving, and opaque aliases reveal only inside their definition boundary or a future code-generation phase. An unrevealed alias retains provable declared bounds and can be related structurally by identity and arguments.

NamedAliasTy

ProjectionTy

OpaqueAliasTy

TypeAliasSymbol

Kind-specific local or external type-alias identity; Rust symbol::TypeAliasSymbol.

ConstSymbol

Kind-specific local or external constant identity; Rust symbol::ConstSymbol.

GenericParam

Stable parameter identity: source-backed Ast, external Ext, or an AlphaEquiv placeholder. Its kind is Type, Lifetime, or Const. See generic_param.rs. {anchor}`scoped_identities` Generic parameters use their own source-backed, external, or alpha-equivalent identity family. A field is identified by its owner plus field index, and a local by its body-local ID; these are not global Symbol variants. Semantic values retain these scoped identities.

InferVarIndex

Dense index identifying an inference variable inside its owning inference context.

ErrorReported

Evidence that a diagnostic has already been recorded for an error-recovery value.

FnSig

Checked function interface; generic parameters are supplied by its enclosing Binder.

CheckedReceiver

MethodReceiver

StructSig

StructFields

FieldSig

EnumSig

VariantSig

ExternalAdtSignatureData

External nominal declaration facts; defaults align with the enclosing binder's parameters.

GenericDefault

TraitRef

Self is supplied separately from this trait reference.

WherePredicate

SolverEligibility

CheckedParameterEnv

TraitSignatureData

TraitSemantics

ImplSignatureData

TraitItemDef

Body

CheckedBody, with storage erased. A recovery result can contain diagnosed error nodes.

TyBody

The completed elaborated tree, with storage ownership erased. {anchor}`body.typed_provenance` Every expression and pattern in a successful completed body has a type and source provenance, including nodes synthesized from a source expression. {anchor}`body.resolved_references` Every path, field, variant, function, and associated-item reference in a successful completed body records its resolved definition identity. {anchor}`body.no_inference` No live inference variable or unresolved semantic choice survives in a successful completed body. Completion resolves type edges and produces the final tree independently of temporary inference state. {anchor}`body.elaborated` Completed bodies consume method syntax and temporary adjustment recipes. Implicit borrows, dereferences, and coercions are explicit typed nodes; successful output contains no source-shaped placeholder for an unresolved operation. Structured control flow remains a tree, without basic blocks, a drop schedule, generator lowering, or borrow-check results. {anchor}`body.diagnosed_recovery` A recovery body represents failure using explicit error nodes backed by diagnostics, never an unresolved choice presented as an ordinary successful node.

TyExpr

LocalVar

LocalId

A body-local variable identity, distinct from global item symbols.

PathResolution

ResolvedCallTarget

{anchor}`calls.selected_semantics` A completed call records the selected function, dispatch family, owner substitutions, and method substitutions. Trait-method calls retain Self and the selected trait reference; the proof justifying a call need not return a concrete impl identity.

CallDispatch

The current Rust representation supports direct and static-trait dispatch. {anchor}`calls.dispatch_families` Completed calls distinguish direct function definitions, statically dispatched trait methods, dynamic trait-object methods, function pointers, and callable-trait dispatch through Fn, FnMut, or FnOnce. Receiver/coercion operations are already explicit tree nodes, not a replayable adjustment list.

TyExprData

{anchor}`body.closures` A completed closure has a typed nested body with explicit parameters and captures. {anchor}`body.coroutines` An async block or async function has a typed nested coroutine body. Typed IR does not lower it into a generator state machine. {anchor}`body.indexing` Index syntax lowers to a resolved Index or IndexMut call with typed operands. {anchor}`body.conditional_patterns` If-let, while-let, and let chains lower into structured match and control-flow forms. {anchor}`body.for_iteration` A for expression lowers into an IntoIterator call followed by a structured loop and match. {anchor}`body.try_residual` The question-mark operator lowers into a Try::branch call, a ControlFlow match, and a FromResidual call. {anchor}`body.await` Await remains a high-level operation over an explicitly resolved IntoFuture conversion and Future::Output type; it does not contain polling, suspension-point, or state-machine lowering. {anchor}`body.macro_expansion` A checked expression represents its macro expansion output; a macro invocation is not itself a successful checked expression node. <!-- end anchor --> Expression forms from tytree::TyExprData. Blocks, conditionals, matches, loops, calls, paths, references, dereferences, NeverToAny coercions, and diagnosed error nodes retain typed children. Current Rust also carries transitional source-shaped forms; their presence in the representation does not establish successful elaboration. {anchor}`operators.trait_calls` Every proven overloadable operator in completed Typed IR is a resolved trait-method call, whether its operands are primitive, generic, or user-defined. The call retains method identity, substitutions, explicit adjustments, and result type; no overloadable case completes as Binary. Primitive recognition belongs to later codegen with concrete substitutions. {anchor}`operators.lazy_control_flow` Non-overloadable && and || remain explicit lazy logical operations whose right-hand side is conditionally evaluated; they do not become eager trait-method calls.

Diagnostic

A source-located diagnostic with severity, labels, and explanatory notes.