diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-04-24 19:25:30 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-04-30 17:40:29 -0700 |
| commit | 944ba8c8a7b54d2bc02bc041747bc120304a831c (patch) | |
| tree | 90b61db5fc51e3800e201bf7fcbc415626e7b3c4 | |
| parent | a15c3a36d712c869b91e5b3e75e368d019253523 (diff) | |
| download | rust-944ba8c8a7b54d2bc02bc041747bc120304a831c.tar.gz rust-944ba8c8a7b54d2bc02bc041747bc120304a831c.zip | |
Fix the rustfmt build
| -rw-r--r-- | src/tools/rustfmt/src/expr.rs | 4 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/utils.rs | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs index 741f3350801..e4cc93026f1 100644 --- a/src/tools/rustfmt/src/expr.rs +++ b/src/tools/rustfmt/src/expr.rs @@ -225,6 +225,10 @@ pub(crate) fn format_expr( ast::ExprKind::Ret(Some(ref expr)) => { rewrite_unary_prefix(context, "return ", &**expr, shape) } + ast::ExprKind::Yeet(None) => Some("do yeet".to_owned()), + ast::ExprKind::Yeet(Some(ref expr)) => { + rewrite_unary_prefix(context, "do yeet ", &**expr, shape) + } ast::ExprKind::Box(ref expr) => rewrite_unary_prefix(context, "box ", &**expr, shape), ast::ExprKind::AddrOf(borrow_kind, mutability, ref expr) => { rewrite_expr_addrof(context, borrow_kind, mutability, expr, shape) diff --git a/src/tools/rustfmt/src/utils.rs b/src/tools/rustfmt/src/utils.rs index 35512e78fa6..ed418fb1fec 100644 --- a/src/tools/rustfmt/src/utils.rs +++ b/src/tools/rustfmt/src/utils.rs @@ -512,6 +512,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr | ast::ExprKind::Range(..) | ast::ExprKind::Repeat(..) | ast::ExprKind::Ret(..) + | ast::ExprKind::Yeet(..) | ast::ExprKind::Tup(..) | ast::ExprKind::Type(..) | ast::ExprKind::Yield(None) |
