aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r--crates/hir_ty/src/diagnostics/expr.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs
index 16bbd48fb..d740b7265 100644
--- a/crates/hir_ty/src/diagnostics/expr.rs
+++ b/crates/hir_ty/src/diagnostics/expr.rs
@@ -2,7 +2,9 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_def::{AdtId, AssocItemId, DefWithBodyId, expr::Statement, path::path, resolver::HasResolver}; 5use hir_def::{
6 expr::Statement, path::path, resolver::HasResolver, AdtId, AssocItemId, DefWithBodyId,
7};
6use hir_expand::{diagnostics::DiagnosticSink, name}; 8use hir_expand::{diagnostics::DiagnosticSink, name};
7use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
8use syntax::{ast, AstPtr}; 10use syntax::{ast, AstPtr};
@@ -163,11 +165,13 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
163 None => return, 165 None => return,
164 }; 166 };
165 let iterator_trait_items = &db.trait_data(iterator_trait_id).items; 167 let iterator_trait_items = &db.trait_data(iterator_trait_id).items;
166 let filter_map_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![filter_map]) { 168 let filter_map_function_id =
167 Some((_, AssocItemId::FunctionId(id))) => id, 169 match iterator_trait_items.iter().find(|item| item.0 == name![filter_map]) {
168 _ => return, 170 Some((_, AssocItemId::FunctionId(id))) => id,
169 }; 171 _ => return,
170 let next_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![next]) { 172 };
173 let next_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![next])
174 {
171 Some((_, AssocItemId::FunctionId(id))) => id, 175 Some((_, AssocItemId::FunctionId(id))) => id,
172 _ => return, 176 _ => return,
173 }; 177 };