Skip to content

Commit ebe634d

Browse files
authored
Unrolled build for rust-lang#124508
Rollup merge of rust-lang#124508 - Zalathar:op, r=jieyouxu coverage: Avoid hard-coded values when visiting logical ops This is a tiny little thing that I noticed during the final review of rust-lang#123409, and I didn't want to hold up the whole PR just for this. Instead of separately hard-coding the operation being visited, we can get it from the match arm pattern by using an as-pattern. `@rustbot` label +A-code-coverage
2 parents e27af29 + a25a11a commit ebe634d

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_mir_build/src/build/matches

1 file changed

+4
-4
lines changed

compiler/rustc_mir_build/src/build/matches/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
7373
let expr_span = expr.span;
7474

7575
match expr.kind {
76-
ExprKind::LogicalOp { op: LogicalOp::And, lhs, rhs } => {
77-
this.visit_coverage_branch_operation(LogicalOp::And, expr_span);
76+
ExprKind::LogicalOp { op: op @ LogicalOp::And, lhs, rhs } => {
77+
this.visit_coverage_branch_operation(op, expr_span);
7878
let lhs_then_block = unpack!(this.then_else_break_inner(block, lhs, args));
7979
let rhs_then_block = unpack!(this.then_else_break_inner(lhs_then_block, rhs, args));
8080
rhs_then_block.unit()
8181
}
82-
ExprKind::LogicalOp { op: LogicalOp::Or, lhs, rhs } => {
83-
this.visit_coverage_branch_operation(LogicalOp::Or, expr_span);
82+
ExprKind::LogicalOp { op: op @ LogicalOp::Or, lhs, rhs } => {
83+
this.visit_coverage_branch_operation(op, expr_span);
8484
let local_scope = this.local_scope();
8585
let (lhs_success_block, failure_block) =
8686
this.in_if_then_scope(local_scope, expr_span, |this| {

0 commit comments

Comments
 (0)