From ebbcf9f458522e76c5a84e6771e0ef434d6d5c5b Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Wed, 7 Apr 2021 12:45:17 +0100 Subject: Fix inference with conditionally compiled tails Fixes #8378 --- crates/hir_ty/src/diagnostics/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_ty/src/diagnostics') diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 79602c3dd..47709c1e8 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs @@ -83,7 +83,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { if let Expr::Block { statements, tail, .. } = body_expr { if let Some(t) = tail { self.validate_results_in_tail_expr(body.body_expr, *t, db); - } else if let Some(Statement::Expr(id)) = statements.last() { + } else if let Some(Statement::Expr { expr: id, .. }) = statements.last() { self.validate_missing_tail_expr(body.body_expr, *id, db); } } -- cgit v1.2.3