Update the comment on lower_expr_try
I'd updated the ones inside the method, but not its doc comment.
This commit is contained in:
parent
aa65b08b1d
commit
099a357e5c
1 changed files with 8 additions and 7 deletions
|
@ -1559,13 +1559,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
|
||||
/// Desugar `ExprKind::Try` from: `<expr>?` into:
|
||||
/// ```rust
|
||||
/// match Try::into_result(<expr>) {
|
||||
/// Ok(val) => #[allow(unreachable_code)] val,
|
||||
/// Err(err) => #[allow(unreachable_code)]
|
||||
/// match Try::branch(<expr>) {
|
||||
/// ControlFlow::Continue(val) => #[allow(unreachable_code)] val,,
|
||||
/// ControlFlow::Break(residual) =>
|
||||
/// #[allow(unreachable_code)]
|
||||
/// // If there is an enclosing `try {...}`:
|
||||
/// break 'catch_target Try::from_error(From::from(err)),
|
||||
/// break 'catch_target Try::from_residual(residual),
|
||||
/// // Otherwise:
|
||||
/// return Try::from_error(From::from(err)),
|
||||
/// return Try::from_residual(residual),
|
||||
/// }
|
||||
/// ```
|
||||
fn lower_expr_try(&mut self, span: Span, sub_expr: &Expr) -> hir::ExprKind<'hir> {
|
||||
|
|
Loading…
Add table
Reference in a new issue