Hax_engine.Phase_simplify_question_marks
In THIR, there are no construct for question marks. Instead, Rustc desugars `e?` into the following:
match core::ops::try_trait::branch(y) {
core::ops::control_flow::Break(residual) => {
never_to_any(
{return core::ops::try_trait::from_residual(residual)},
)
}
core::ops::control_flow::Continue(val) => val,
})
This phase does the opposite rewrite.
While `e?` in Rust might implies an implicit coercion, in our AST, a question mark is expected to already be of the right type. This phase inlines a coercion (of the shape `x.map_err(from)`, in the case of a `Result`).
module Make (F : Features.T) : sig ... end
This phase can be applied to any feature set.