Expand description
Passes that undo some lowering done by rustc to recover an operation closer to what the user wrote.
Modulesยง
- inline_
local_ panic_ functions panic!()
expands to:- reconstruct_
asserts - In the MIR AST, it seems
assert
are introduced to check preconditions (for the binops for example). Theassert!
introduced by the user introduceif ... then { panic!(...) } else { ...}
. This pass introducesassert
instead in order to make the code shorter. - reconstruct_
boxes - Micro-pass: reconstruct piecewise box allocations using
malloc
andShallowInitBox
. - reconstruct_
fallible_ operations - Micro-pass: remove the dynamic checks for array/slice bounds, overflow, and division by zero.
- reconstruct_
matches - The way to match on enums in MIR is in two steps: first read the discriminant, then switch on
the resulting integer. This pass merges the two into a
SwitchKind::Match
that directly mentions enum variants.