diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 16 |
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 | ||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use hir_def::{AdtId, AssocItemId, DefWithBodyId, expr::Statement, path::path, resolver::HasResolver}; | 5 | use hir_def::{ |
6 | expr::Statement, path::path, resolver::HasResolver, AdtId, AssocItemId, DefWithBodyId, | ||
7 | }; | ||
6 | use hir_expand::{diagnostics::DiagnosticSink, name}; | 8 | use hir_expand::{diagnostics::DiagnosticSink, name}; |
7 | use rustc_hash::FxHashSet; | 9 | use rustc_hash::FxHashSet; |
8 | use syntax::{ast, AstPtr}; | 10 | use 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 | }; |