1
Fork 0

Rollup merge of #86994 - scottmcm:fix_expr_try_comment, r=petrochenkov

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:
Mara Bos 2021-07-09 16:20:35 +02:00 committed by GitHub
commit 98f35589f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)]
/// // If there is an enclosing `try {...}`:
/// break 'catch_target Try::from_error(From::from(err)),
/// // Otherwise:
/// return Try::from_error(From::from(err)),
/// 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_residual(residual),
/// // Otherwise:
/// return Try::from_residual(residual),
/// }
/// ```
fn lower_expr_try(&mut self, span: Span, sub_expr: &Expr) -> hir::ExprKind<'hir> {