From 65a5ea581d547c36e98b4a3c5a99671ad5d4c117 Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Fri, 1 Jan 2021 21:40:11 +0000 Subject: Update tests to register the required standard library types --- crates/hir_ty/src/diagnostics/expr.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'crates/hir_ty/src/diagnostics') 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 @@ use std::sync::Arc; -use hir_def::{AdtId, AssocItemId, DefWithBodyId, expr::Statement, path::path, resolver::HasResolver}; +use hir_def::{ + expr::Statement, path::path, resolver::HasResolver, AdtId, AssocItemId, DefWithBodyId, +}; use hir_expand::{diagnostics::DiagnosticSink, name}; use rustc_hash::FxHashSet; use syntax::{ast, AstPtr}; @@ -163,11 +165,13 @@ impl<'a, 'b> ExprValidator<'a, 'b> { None => return, }; let iterator_trait_items = &db.trait_data(iterator_trait_id).items; - let filter_map_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![filter_map]) { - Some((_, AssocItemId::FunctionId(id))) => id, - _ => return, - }; - let next_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![next]) { + let filter_map_function_id = + match iterator_trait_items.iter().find(|item| item.0 == name![filter_map]) { + Some((_, AssocItemId::FunctionId(id))) => id, + _ => return, + }; + let next_function_id = match iterator_trait_items.iter().find(|item| item.0 == name![next]) + { Some((_, AssocItemId::FunctionId(id))) => id, _ => return, }; -- cgit v1.2.3