Skip to content

Commit cd4f745

Browse files
author
yossydev
committed
fix
1 parent 369933a commit cd4f745

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,15 +1669,15 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16691669
let hir = tcx.hir();
16701670
let item = hir.get_parent_item(expr.hir_id);
16711671

1672-
if let some(node) = tcx.opt_hir_node(item.into())
1673-
&& let some(body_id) = node.body_id()
1674-
&& let some(sig) = node.fn_sig()
1675-
&& let hir::exprkind::block(block, _) = hir.body(body_id).value.kind
1672+
if let Some(node) = tcx.opt_hir_node(item.into())
1673+
&& let Some(body_id) = node.body_id()
1674+
&& let Some(sig) = node.fn_sig()
1675+
&& let hir::ExprKind::Block(block, _) = hir.body(body_id).value.kind
16761676
&& !ty.is_never()
16771677
{
16781678
for stmt in block.stmts {
1679-
if let hir::stmtkind::local(local) = stmt.kind {
1680-
if let hir::patkind::binding(_, _, _, none) = local.pat.kind {
1679+
if let hir::StmtKind::Local(local) = stmt.kind {
1680+
if let hir::PatKind::Binding(_, _, _, None) = local.pat.kind {
16811681
err.span_note(
16821682
stmt.span,
16831683
"This pattern has a single binding, which might cause issues if the loop doesn't execute. Consider handling the case where the loop might not run.",

0 commit comments

Comments
 (0)