From ed59512d02b5194d362ab6842b66803a334ca40e Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 12 Oct 2020 17:16:57 +0200 Subject: Fix iterator hint shortening heuristic --- crates/ide/src/inlay_hints.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 2ed84095d..e2079bbcf 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -220,8 +220,8 @@ fn hint_iterator( } let iter_trait = FamousDefs(sema, krate).core_iter_Iterator()?; let iter_mod = FamousDefs(sema, krate).core_iter()?; - // assert this type comes from `core::iter` - iter_mod.visibility_of(db, &iter_trait.into()).filter(|&vis| vis == hir::Visibility::Public)?; + // assert this struct comes from `core::iter` + iter_mod.visibility_of(db, &strukt.into()).filter(|&vis| vis == hir::Visibility::Public)?; if ty.impls_trait(db, iter_trait, &[]) { let assoc_type_item = iter_trait.items(db).into_iter().find_map(|item| match item { hir::AssocItem::TypeAlias(alias) if alias.name(db) == known::Item => Some(alias), -- cgit v1.2.3