Description
These are the result of auditing (as of 0003184) for panic opportunities. Some have been left off which are either unavoidable, in progress of being removed (#1658), or downstream of ones listed here (namely, downstream of is_bit_valid
).
validate_cast_and_convert_metadata
Lines 444 to 445 in 0003184
We should be able to make this work via a post-monomorphization error instead, and thus avoid a panic opportunity.
PointerMetadata::size_for_metadata
Lines 719 to 721 in 0003184
TryFromBytes::is_bit_valid
Lines 1243 to 1251 in 0003184
Now that const eval semantics are more nailed down, we can probably stop hedging that this might panic and just guarantee a post-monomorphization error.
Note that many panics are downstream of is_bit_valid
. If we tackle this, we should make sure to remove panic documentation from all downstream functions.
round_down_to_next_multiple_of_alignment
Lines 623 to 624 in 0003184
We could benefit from a power-of-two witness type.