rustc_middle - Rust (original) (raw)

Expand description

The “main crate” of the Rust compiler. This crate contains common type definitions that are used by the other crates in the rustc “family”. The following are some prominent examples.

For more information about how rustc works, see the rustc dev guide.

§Note

This API is completely unstable and subject to change.

arena

dep_graph

error

hir

HIR datatypes. See the rustc dev guide for more info.

hooks

“Hooks” let you write tcx methods in downstream crates and call them in this crate, reducing the amount of code that needs to be in this crate (which is already very big). This is somewhat similar to queries, but queries come with a lot of machinery for caching and incremental compilation, whereas hooks are just plain function pointers without any of the query magic.

infer

lint

macros 🔒

metadata

middle

mir

MIR datatypes and passes. See the rustc dev guide for more info.

query

Defines the various compiler queries.

thir

THIR datatypes and definitions. See the rustc dev guide for more info.

traits

Trait Resolution. See the rustc dev guide for more information on how this works.

ty

Defines how the compiler represents types internally.

util

values 🔒

__impl_decoder_methods

arena_types

This higher-order macro declares a list of types which can be allocated by Arena.

bug

A macro for triggering an ICE. Calling bug instead of panicking will result in a nicer error message and should therefore be preferred over panic/unreachable or others.

err_exhaust

err_inval

err_machine_stop

err_ub

err_ub_custom

err_ub_format

err_unsup

err_unsup_format

implement_ty_decoder

make_dep_kind_array

make_dep_kind_name_array

parameterized_over_tcx

rustc_with_all_queries

Higher-order macro that invokes the specified macro with a prepared list of all query signatures (including modifiers).

span_bug

A macro for triggering an ICE with a span. Calling span_bug! instead of panicking will result in a nicer error message and point at the code the compiler was compiling when it ICEd. This is the preferred way to trigger ICEs.

throw_exhaust

throw_inval

throw_machine_stop

throw_ub

throw_ub_custom

throw_ub_format

throw_unsup

throw_unsup_format

trivially_parameterized_over_tcx

DEFAULT_LOCALE_RESOURCE

Raw content of Fluent resource for this crate, generated by fluent_messages macro, imported by rustc_driver to include all crates’ resources in one bundle.