about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-26 14:43:15 +0000
committerbors <bors@rust-lang.org>2024-02-26 14:43:15 +0000
commit50987bb36df2cb377fea181b78b93648e7d0d757 (patch)
tree7136a19eee841dfaf5815f9373a0ac2d9d846dfe
parent8c337451c16fcd27dfae39848091c0e41bf41c57 (diff)
parent1bbfb76993eafc9828af62588f13fe68eaeb4e1a (diff)
downloadrust-50987bb36df2cb377fea181b78b93648e7d0d757.tar.gz
rust-50987bb36df2cb377fea181b78b93648e7d0d757.zip
Auto merge of #120586 - ShE3py:exprkind-err, r=fmease
Add `ErrorGuaranteed` to `ast::ExprKind::Err`

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

r? fmease
-rw-r--r--src/expr.rs2
-rw-r--r--src/utils.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/expr.rs b/src/expr.rs
index 4b86c2acdc5..c500b30b998 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -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
diff --git a/src/utils.rs b/src/utils.rs
index 642b6603b1e..d4218cff75a 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -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(..)