Description
In #129392, I fixed a couple soundness holes having to do with the distinction between values and places and the !
type, which has special divergence and coercion behavior in HIR typeck.
To do so, I implemented a heuristic called expr_guaranteed_to_constitute_read_for_never
(and same for patterns, pat_guaranteed...
), which determines whether an expression/pattern is guaranteed to perform a read of a value of type !
, which triggers the special divergence and coercion behavior. Read the description of the PR to see what the behavior is after the PR.
There's still some open questions about what expressions and patterns should be considered reads in the HIR (such as reading structs with only field subpatterns that don't read, like Struct { .. }
), but I'd like to separate that since the PR #129392 is strictly an improvement over the existing behavior.