Skip to content

Commit

Permalink
Auto merge of rust-lang#120586 - ShE3py:exprkind-err, r=fmease
Browse files Browse the repository at this point in the history
Add `ErrorGuaranteed` to `ast::ExprKind::Err`

See rust-lang#119967 for context
```
      \
       \
          _~^~^~_
      \) /  o o  \ (/
        '_   -   _'
        / '-----' \
```

r? fmease
  • Loading branch information
bors committed Feb 26, 2024
2 parents 8c33745 + 1bbfb76 commit 50987bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ pub(crate) fn format_expr(
// These do not occur in the AST because macros aren't expanded.
unreachable!()
}
ast::ExprKind::Err => None,
ast::ExprKind::Err(_) | ast::ExprKind::Dummy => None,
};

expr_rw
Expand Down
3 changes: 2 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
| ast::ExprKind::Break(..)
| ast::ExprKind::Cast(..)
| ast::ExprKind::Continue(..)
| ast::ExprKind::Err
| ast::ExprKind::Dummy
| ast::ExprKind::Err(_)
| ast::ExprKind::Field(..)
| ast::ExprKind::IncludedBytes(..)
| ast::ExprKind::InlineAsm(..)
Expand Down

0 comments on commit 50987bb

Please sign in to comment.