pub open spec fn try_laws<R: Try>() -> boolExpand description
{
&&& R::branch_model_is_valid()
&&& forall |output: R::Output, result: R| {
#[trigger] R::from_output.ensures((output,), result)
==> R::branch_model(result) == ControlFlow::Continue(output)
}
&&& forall |residual: R::Residual, result: R| {
#[trigger]
<R as FromResidual<R::Residual>>::from_residual.ensures((residual,), result)
==> R::branch_model(result) == ControlFlow::Break(residual)
}
}We can provide stronger guarantees for types that obey these laws