rustc_data_structures - Rust (original) (raw)

Crate rustc_data_structures

Source

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.

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

fingerprint

flat_map_in_place

flock

Simple file-locking apis for each OS.

frozen

An immutable, owned value (except for interior mutability).

fx

graph

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 for ThinVec.

thousands

This is an extremely bare-bones alternative to the thousands crate on crates.io, for printing large numbers in a readable fashion.

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

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.

AtomicRef

This is essentially an AtomicPtr but is guaranteed to always be valid

FatalErrorMarker

This is a marker for a fatal compiler error used with resume_unwind.

OnDrop

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.