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Β§
- match_pair π
- simplify πSimplifying Candidates
- test π
- util π
StructsΒ§
- ArmHasGuard π
ArmHasGuardis a wrapper around a boolean flag. It indicates whether a match arm has a guard expression attached to it. - Ascription πIndicates that the type of
sourcemust be a subtype of the user-given typeuser_ty; this is basically a no-op but can influence region inference. - Binding π
- Candidate π
- FlatPat πA pattern in a form suitable for generating code.
- MatchPairTree π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.
- PatternExtraData π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
Candidatematches a value. - ThenElseArgs πArguments to
Builder::then_else_break_innerthat are usually forwarded to recursive invocations.
EnumsΒ§
- DeclareLetBindings πShould lowering a
letexpression also declare its bindings? - EmitStorageLive πUsed by
Builder::bind_matched_candidate_for_arm_bodyto determine whether or not to callBuilder::storage_live_bindingto emitStatementKind::StorageLive. - ScheduleDrops πUsed by
Builder::storage_live_bindingandBuilder::bind_matched_candidate_for_arm_bodyto decide whether to schedule drops. - TestBranch πThe branch to be taken after a test.
- TestCase π
- TestKind πSee
Testfor more.
FunctionsΒ§
- traverse_candidate πA depth-first traversal of the
Candidateand all of its recursive subcandidates.