Module simplify

Source
Expand description

Simplification of where-clauses and parameter bounds into a prettier and more canonical form.

Currently all cross-crate-inlined function use rustc_middle::ty to reconstruct the AST (e.g., see all of clean::inline), but this is not always a non-lossy transformation. The current format of storage for where-clauses for functions and such is simply a list of predicates. One example of this is that the AST predicate of: where T: Trait<Foo = Bar> is encoded as: where T: Trait, <T as Trait>::Foo = Bar.

This module attempts to reconstruct the original where and/or parameter bounds by special casing scenarios such as these. Fun!

Functionsยง

merge_bounds ๐Ÿ”’
move_bounds_to_generic_parameters ๐Ÿ”’
Move bounds that are (likely) directly attached to generic parameters from the where-clause to the respective parameter.
sized_bounds ๐Ÿ”’
trait_is_same_or_supertrait ๐Ÿ”’
where_clauses ๐Ÿ”’