File tree 1 file changed +8
-7
lines changed
compiler/rustc_ast_lowering/src
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1559,13 +1559,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
1559
1559
1560
1560
/// Desugar `ExprKind::Try` from: `<expr>?` into:
1561
1561
/// ```rust
1562
- /// match Try::into_result(<expr>) {
1563
- /// Ok(val) => #[allow(unreachable_code)] val,
1564
- /// Err(err) => #[allow(unreachable_code)]
1565
- /// // If there is an enclosing `try {...}`:
1566
- /// break 'catch_target Try::from_error(From::from(err)),
1567
- /// // Otherwise:
1568
- /// return Try::from_error(From::from(err)),
1562
+ /// match Try::branch(<expr>) {
1563
+ /// ControlFlow::Continue(val) => #[allow(unreachable_code)] val,,
1564
+ /// ControlFlow::Break(residual) =>
1565
+ /// #[allow(unreachable_code)]
1566
+ /// // If there is an enclosing `try {...}`:
1567
+ /// break 'catch_target Try::from_residual(residual),
1568
+ /// // Otherwise:
1569
+ /// return Try::from_residual(residual),
1569
1570
/// }
1570
1571
/// ```
1571
1572
fn lower_expr_try ( & mut self , span : Span , sub_expr : & Expr ) -> hir:: ExprKind < ' hir > {
You can’t perform that action at this time.
0 commit comments