diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 6a53be621d..bd4ef69a07 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs @@ -667,7 +667,7 @@ impl Expectation { } mod diagnostics { - use hir_def::{expr::ExprId, src::HasSource, FunctionId, Lookup}; + use hir_def::{expr::ExprId, FunctionId}; use hir_expand::diagnostics::DiagnosticSink; use crate::{db::HirDatabase, diagnostics::NoSuchField}; @@ -686,10 +686,9 @@ mod diagnostics { ) { match self { InferenceDiagnostic::NoSuchField { expr, field } => { - let source = owner.lookup(db.upcast()).source(db.upcast()); let (_, source_map) = db.body_with_source_map(owner.into()); let field = source_map.field_syntax(*expr, *field); - sink.push(NoSuchField { file: source.file_id, field: field.value }) + sink.push(NoSuchField { file: field.file_id, field: field.value }) } } }