Expand description
This module used to be named build, but that was causing GitHub’s
“Go to file” feature to silently ignore all files in the module, probably
because it assumes that “build” is a build-output directory.
See https://github.com/rust-lang/rust/pull/134365.
Modules§
- block 🔒
- cfg 🔒
- Routines for manipulating the control-flow graph.
- coverageinfo 🔒
- custom 🔒
- Provides the implementation of the
custom_mirattribute. - expr 🔒
- Builds MIR from expressions. As a caller into this module, you have many options, but the first thing you have to decide is whether you are evaluating this expression for its value, its location, or as a constant.
- matches 🔒
- Code related to match expressions. These are sufficiently complex to warrant their own module and submodules. :) This main module includes the high-level algorithm, the submodules contain the details.
- misc 🔒
- Miscellaneous builder routines that are not specific to building any particular kind of thing.
- scope 🔒
- Managing the scope stack. The scopes are tied to lexical scopes, so as
we descend the THIR, we push a scope on the stack, build its
contents, and then pop it off. Every scope is named by a
region::Scope.
Macros§
- unpack 🔒
- Update a block pointer and return the value.
Use it like
let x = unpack!(block = self.foo(block, foo)).
Structs§
- Block
And 🔒 - The
BlockAnd“monad” packages up the new basic block along with a produced value (sometimes just unit, of course). Theunpack!macro (and methods below) makes working withBlockAndmuch more convenient. - Block
Context 🔒 - Builder 🔒
- CFG 🔒
- Capture 🔒
- Guard
Frame 🔒 - Guard
Frame 🔒Local - ScopeId 🔒
Enums§
- Block
Frame 🔒 - ForGuard 🔒
ForGuardindicates whether we are talking about:- Locals
ForNode 🔒 - Needs
Temporary 🔒
Traits§
Functions§
- build_
mir - Create the MIR for a given
DefId, including unreachable code. Do not call this directly; instead use the cached version viamir_built. - closure_
saved_ 🔒names_ of_ captured_ variables - construct_
const 🔒 - construct_
error 🔒 - Construct MIR for an item that has had errors in type checking.
- construct_
fn 🔒 - the main entry point for building MIR for a function
- parse_
float_ 🔒into_ constval - parse_
float_ 🔒into_ scalar