}
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};
) {
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 })
}
}
}