mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Update tests to register the required standard library types
This commit is contained in:
parent
7c691f51f9
commit
65a5ea581d
2 changed files with 48 additions and 16 deletions
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue