Module check_enums

Source

Structsยง

CheckEnums ๐Ÿ”’
This pass inserts checks for a valid enum discriminant where they are most likely to find UB, because checking everywhere like Miri would generate too much MIR.
EnumFinder ๐Ÿ”’
A Visitor that finds the construction of enums and evaluates which checks we should apply.
TyAndSize ๐Ÿ”’

Enumsยง

EnumCheckType ๐Ÿ”’
Represent the different kind of enum checks we can insert.

Functionsยง

insert_direct_enum_check ๐Ÿ”’
insert_discr_cast_to_u128 ๐Ÿ”’
Inserts the cast of an operand (any type) to a u128 value that holds the discriminant value.
insert_niche_check ๐Ÿ”’
insert_uninhabited_enum_check ๐Ÿ”’
split_block ๐Ÿ”’