Expand description
ยงPolymorphization Analysis
This module implements an analysis of functions, methods and closures to determine which generic parameters are unused (and eventually, in what ways generic parameters are used - only for their size, offset of a field, etc.).
Structsยง
- Visitor used to aggregate generic parameter uses.
Functionsยง
- Emit errors for the function annotated by
#[rustc_polymorphize_error]
, labelling each generic parameter which was unused. - Some parameters are considered used-by-default, such as non-generic parameters and the dummy generic parameters from closures, this function marks them as used.
leaf_is_closure
should betrue
if the item thatunused_generic_params
was invoked on is a closure. - provide ๐Provide implementations of queries relating to polymorphization analysis.
- should_
polymorphize ๐Returnstrue
if the instance should be polymorphized. - Determine which generic parameters are used by the instance.