Module rustc_mir_build::build::matches
source · Expand description
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.
This also includes code for pattern bindings in let
statements and
function parameters.
Modules§
Structs§
ArmHasGuard
is a wrapper around a boolean flag. It indicates whether a match arm has a guard expression attached to it.- Indicates that the type of
source
must be a subtype of the user-given typeuser_ty
; this is basically a no-op but can influence region inference. - Binding 🔒
- FlatPat 🔒A pattern in a form suitable for generating code.
- Node in a tree of “match pairs”, where each pair consists of a place to be tested, and a test to perform on that place.
- Data extracted from a pattern that doesn’t affect which branch is taken. Collected during pattern simplification and not mutated later.
- Test 🔒A test to perform to determine which
Candidate
matches a value. - Arguments to
Builder::then_else_break_inner
that are usually forwarded to recursive invocations.
Enums§
- Should lowering a
let
expression also declare its bindings? - Used by
Builder::bind_matched_candidate_for_arm_body
to determine whether or not to callBuilder::storage_live_binding
to emitStatementKind::StorageLive
. - Used by
Builder::storage_live_binding
andBuilder::bind_matched_candidate_for_arm_body
to decide whether to schedule drops. - The branch to be taken after a test.
- TestCase 🔒
- TestKind 🔒See
Test
for more.
Functions§
- A depth-first traversal of the
Candidate
and all of its recursive subcandidates.