diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-15 12:39:24 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-15 12:39:24 +0000 |
commit | a8b319cf28c0985d964ef6624c3ee6e7f09afb2d (patch) | |
tree | 2ee4aa8e66b3371f8cbf65b2c4951d5e2c227cb4 /crates/hir_ty/src/infer.rs | |
parent | b4446cdd06caa32e1e9e255312a15feb770d4935 (diff) | |
parent | f7156cb0aeaba8fe32c381a2d676b35d2c86f46f (diff) |
Merge #8026
8026: Simplify source maps for fields r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r-- | crates/hir_ty/src/infer.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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 { | |||
784 | 784 | ||
785 | #[derive(Debug, PartialEq, Eq, Clone)] | 785 | #[derive(Debug, PartialEq, Eq, Clone)] |
786 | pub(super) enum InferenceDiagnostic { | 786 | pub(super) enum InferenceDiagnostic { |
787 | NoSuchField { expr: ExprId, field: usize }, | 787 | NoSuchField { expr: ExprId }, |
788 | BreakOutsideOfLoop { expr: ExprId }, | 788 | BreakOutsideOfLoop { expr: ExprId }, |
789 | } | 789 | } |
790 | 790 | ||
@@ -796,9 +796,9 @@ mod diagnostics { | |||
796 | sink: &mut DiagnosticSink, | 796 | sink: &mut DiagnosticSink, |
797 | ) { | 797 | ) { |
798 | match self { | 798 | match self { |
799 | InferenceDiagnostic::NoSuchField { expr, field } => { | 799 | InferenceDiagnostic::NoSuchField { expr } => { |
800 | let (_, source_map) = db.body_with_source_map(owner); | 800 | let (_, source_map) = db.body_with_source_map(owner); |
801 | let field = source_map.field_syntax(*expr, *field); | 801 | let field = source_map.field_syntax(*expr); |
802 | sink.push(NoSuchField { file: field.file_id, field: field.value }) | 802 | sink.push(NoSuchField { file: field.file_id, field: field.value }) |
803 | } | 803 | } |
804 | InferenceDiagnostic::BreakOutsideOfLoop { expr } => { | 804 | InferenceDiagnostic::BreakOutsideOfLoop { expr } => { |