aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
authorPhil Ellison <[email protected]>2021-01-01 21:40:11 +0000
committerPhil Ellison <[email protected]>2021-01-23 07:40:25 +0000
commit65a5ea581d547c36e98b4a3c5a99671ad5d4c117 (patch)
tree844d804814648344af7ec2a2fe1a334001eeef81 /crates/hir_ty/src/diagnostics
parent7c691f51f9974572e1e56c0e368b973ed3e58365 (diff)
Update tests to register the required standard library types
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 };