summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_builtin_macros/src/assert/context.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_builtin_macros/src/assert/context.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_builtin_macros/src/assert/context.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/assert/context.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/compiler/rustc_builtin_macros/src/assert/context.rs b/compiler/rustc_builtin_macros/src/assert/context.rs
index 0682d48ac..2a4bfe9e2 100644
--- a/compiler/rustc_builtin_macros/src/assert/context.rs
+++ b/compiler/rustc_builtin_macros/src/assert/context.rs
@@ -193,10 +193,9 @@ impl<'cx, 'a> Context<'cx, 'a> {
fn manage_cond_expr(&mut self, expr: &mut P<Expr>) {
match &mut expr.kind {
ExprKind::AddrOf(_, mutability, local_expr) => {
- self.with_is_consumed_management(
- matches!(mutability, Mutability::Mut),
- |this| this.manage_cond_expr(local_expr)
- );
+ self.with_is_consumed_management(matches!(mutability, Mutability::Mut), |this| {
+ this.manage_cond_expr(local_expr)
+ });
}
ExprKind::Array(local_exprs) => {
for local_expr in local_exprs {
@@ -223,7 +222,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
|this| {
this.manage_cond_expr(lhs);
this.manage_cond_expr(rhs);
- }
+ },
);
}
ExprKind::Call(_, local_exprs) => {
@@ -285,10 +284,9 @@ impl<'cx, 'a> Context<'cx, 'a> {
}
}
ExprKind::Unary(un_op, local_expr) => {
- self.with_is_consumed_management(
- matches!(un_op, UnOp::Neg | UnOp::Not),
- |this| this.manage_cond_expr(local_expr)
- );
+ self.with_is_consumed_management(matches!(un_op, UnOp::Neg | UnOp::Not), |this| {
+ this.manage_cond_expr(local_expr)
+ });
}
// Expressions that are not worth or can not be captured.
//
@@ -296,7 +294,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
// sync with the `rfc-2011-nicer-assert-messages/all-expr-kinds.rs` test.
ExprKind::Assign(_, _, _)
| ExprKind::AssignOp(_, _, _)
- | ExprKind::Async(_, _)
+ | ExprKind::Gen(_, _, _)
| ExprKind::Await(_, _)
| ExprKind::Block(_, _)
| ExprKind::Break(_, _)