Skip to content

Commit 03fbb3d

Browse files
committed
Expand parameters.
1 parent e73aeea commit 03fbb3d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for MatchVisitor<'a, '_, 'tcx> {
144144
ExprKind::Let { box ref pat, expr } => {
145145
self.check_let(pat, expr, self.let_source, ex.span);
146146
}
147-
ExprKind::LogicalOp { op: LogicalOp::And, .. } => {
148-
self.check_let_chain(ex, self.let_source);
147+
ExprKind::LogicalOp { op: LogicalOp::And, lhs, rhs } => {
148+
self.check_let_chain(self.let_source, ex.span, lhs, rhs);
149149
}
150150
_ => {}
151151
};
@@ -296,13 +296,17 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
296296
}
297297

298298
#[instrument(level = "trace", skip(self))]
299-
fn check_let_chain(&mut self, top_expr: &Expr<'tcx>, let_source: LetSource) {
299+
fn check_let_chain(
300+
&mut self,
301+
let_source: LetSource,
302+
top_expr_span: Span,
303+
mut lhs: ExprId,
304+
rhs: ExprId,
305+
) {
300306
if let LetSource::None = let_source {
301307
return;
302308
}
303309

304-
let ExprKind::LogicalOp { op: LogicalOp::And, mut lhs, rhs } = top_expr.kind else { bug!() };
305-
306310
// Lint level enclosing the next `lhs`.
307311
let mut cur_lint_level = self.lint_level;
308312

@@ -367,7 +371,7 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
367371
self.lint_level,
368372
let_source,
369373
chain_refutabilities.len(),
370-
top_expr.span,
374+
top_expr_span,
371375
);
372376
return;
373377
}

0 commit comments

Comments
 (0)