From f7156cb0aeaba8fe32c381a2d676b35d2c86f46f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 15 Mar 2021 15:38:50 +0300 Subject: Simplify source maps for fields --- crates/hir_ty/src/infer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/infer.rs') diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index fbfedb4e6..9f29098ee 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -784,7 +784,7 @@ mod diagnostics { #[derive(Debug, PartialEq, Eq, Clone)] pub(super) enum InferenceDiagnostic { - NoSuchField { expr: ExprId, field: usize }, + NoSuchField { expr: ExprId }, BreakOutsideOfLoop { expr: ExprId }, } @@ -796,9 +796,9 @@ mod diagnostics { sink: &mut DiagnosticSink, ) { match self { - InferenceDiagnostic::NoSuchField { expr, field } => { + InferenceDiagnostic::NoSuchField { expr } => { let (_, source_map) = db.body_with_source_map(owner); - let field = source_map.field_syntax(*expr, *field); + let field = source_map.field_syntax(*expr); sink.push(NoSuchField { file: field.file_id, field: field.value }) } InferenceDiagnostic::BreakOutsideOfLoop { expr } => { -- cgit v1.2.3