Expand description
Passes that make the output simpler/easier to consume.
Modules§
- hide_
allocator_ param - hide_
marker_ traits - index_
intermediate_ assigns - This micro-pass introduces intermediate assignments in preparation of
crate::transform::simplify_output::index_to_function_calls
, so as to avoid borrow-checking errors. - index_
to_ function_ calls - Desugar array/slice index operations to function calls.
- inline_
promoted_ consts - lift_
associated_ item_ clauses - Move clauses on non-gat associated types to be parent clauses. The distinction is not semantically meaningful. We should ideally to this directly when translating but this is currently difficult; instead we do this as a post-processing pass.
- ops_
to_ function_ calls - Desugar some unary/binary operations and the array repeats to function calls. For instance, we desugar ArrayToSlice from an unop to a function call. This allows a more uniform treatment later on. TODO: actually transform all the unops and binops to function calls?
- remove_
nops - Remove the useless no-ops.
- remove_
unit_ locals - remove_
unused_ locals - Remove the locals (which are not used for the input arguments) which are
never used in the function bodies. This is useful to remove the locals with
type
Never
. We actually check that there are no such local variables remaining afterwards. - remove_
unused_ self_ clause - We have added an explicit
Self: Trait
clause to the function and global items that correspond to a trait method/associated const declaration. This pass removes the clause in question if it is not used by the item. - simplify_
constants - The MIR constant expressions lead to a lot of duplication: there are for instance constant ADTs which duplicate the “regular” aggregated ADTs in the operands, constant references, etc. This reduces the number of cases to handle and eases the function translation in Aeneas.
- unbind_
item_ vars - Replace variables bound at the top-level with
Free
vars. This is for convenience for consumers of the charon ast. - update_
block_ indices - Update the block indices to make sure they are consecutive