Expand description
Various data structures used by the Rust compiler. The intention is that code in here should not be specific to rustc, so that it can be easily unit tested and so forth.
§Note
This API is completely unstable and subject to change.
Modules§
- aligned
- atomic_
ref 🔒 - base_n
- Converts unsigned integers into a string representation with some base. Bases up to and including 36 can be used for case-insensitive things.
- binary_
search_ util - captures
- fingerprint
- flat_
map_ in_ place - flock
- Simple file-locking apis for each OS.
- frozen
- An immutable, owned value (except for interior mutability).
- fx
- graph
- hashes 🔒
- rustc encodes a lot of hashes. If hashes are stored as
u64
oru128
, aderive(Encodable)
will apply varint encoding to the hashes, which is less efficient than directly encoding the 8 or 16 bytes of the hash. - intern
- jobserver
- marker
- memmap
- obligation_
forest - The
ObligationForest
is a utility data structure used in trait matching to track the set of outstanding obligations (those not yet resolved to success or error). It also tracks the “backtrace” of each pending obligation (why we are trying to figure this out in the first place). - owned_
slice - packed
- profiling
- Rust Compiler Self-Profiling
- sharded
- small_
c_ str - snapshot_
map - snapshot_
vec - A utility class for implementing “snapshottable” things; a snapshottable data structure permits
you to take a snapshot (via
start_snapshot
) and then, after making some changes, elect either to rollback to the start of the snapshot or commit those changes. - sorted_
map - sso
- stable_
hasher - stack
- steal
- svh
- Calculation and management of a Strict Version Hash for crates
- sync
- This module defines various operations and types that are implemented in one way for the serial compiler, and another way the parallel compiler.
- tagged_
ptr - This module implements tagged pointers. In order to utilize the pointer
packing, you must have a tag type implementing the
Tag
trait. - temp_
dir - thinvec
- This is a copy-paste of
Vec::extract_if
forThinVec
. - transitive_
relation - undo_
log - Module which contains the snapshot/rollback functionality of the
ena
data structures. - unhash
- unify
- Union-find implementation. The main type is
UnificationTable
. - unord
- This module contains collection types that don’t expose their internal ordering. This is a useful property for deterministic computations, such as required by the query system.
- vec_
cache - VecCache maintains a mapping from K -> (V, I) pairing. K and I must be roughly u32-sized, and V must be Copy.
- work_
queue
Macros§
- define_
id_ collections - define_
stable_ id_ collections - external_
bitflags_ debug - parallel
- Runs a list of blocks in parallel. The first block is executed immediately on the current thread. Use that for the longest running block.
- static_
assert_ size - Type size assertion. The first argument is a type and the second argument is its expected size.
Structs§
- Atomic
Ref - This is essentially an
AtomicPtr
but is guaranteed to always be valid - Fatal
Error Marker - This is a marker for a fatal compiler error used with
resume_unwind
. - OnDrop
Functions§
- defer
- Returns a structure that calls
f
when dropped. - make_
display - Turns a closure that takes an
&mut Formatter
into something that can be display-formatted. - outline
- This calls the passed function while ensuring it won’t be inlined into the caller.