Module remove_dynamic_checks

Source
Expand description

Β§Micro-pass: remove the dynamic checks for array/slice bounds, overflow, and division by zero.

Note that from a semantic point of view, an out-of-bound access or a division by zero must lead to a panic in Rust (which is why those checks are always present, even when compiling for release). In our case, we take this into account in the semantics of our array/slice manipulation and arithmetic functions, on the verification side.

StructsΒ§

Transform

FunctionsΒ§

equiv_op πŸ”’
Check if the two operands are equivalent: either they’re the same constant, or they represent the same place (regardless of whether the operand is a move or a copy)
make_binop_overflow_panic πŸ”’
make_unop_overflow_panic πŸ”’
remove_dynamic_checks πŸ”’
Rustc inserts dynamic checks during MIR lowering. They all end in an Assert statement (and this is the only use of this statement).
uses_local πŸ”’
Whether the value uses the given local in a place.