diff options
author | Lukas Wirth <[email protected]> | 2020-10-12 16:16:57 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-10-12 16:18:21 +0100 |
commit | ed59512d02b5194d362ab6842b66803a334ca40e (patch) | |
tree | c317c1174e21533e4d4c211fb0ad4d3285e22e39 /crates/ide | |
parent | fac59f4f28e3ede6c88999aa43d28e7caa7df3a7 (diff) |
Fix iterator hint shortening heuristic
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/inlay_hints.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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( | |||
220 | } | 220 | } |
221 | let iter_trait = FamousDefs(sema, krate).core_iter_Iterator()?; | 221 | let iter_trait = FamousDefs(sema, krate).core_iter_Iterator()?; |
222 | let iter_mod = FamousDefs(sema, krate).core_iter()?; | 222 | let iter_mod = FamousDefs(sema, krate).core_iter()?; |
223 | // assert this type comes from `core::iter` | 223 | // assert this struct comes from `core::iter` |
224 | iter_mod.visibility_of(db, &iter_trait.into()).filter(|&vis| vis == hir::Visibility::Public)?; | 224 | iter_mod.visibility_of(db, &strukt.into()).filter(|&vis| vis == hir::Visibility::Public)?; |
225 | if ty.impls_trait(db, iter_trait, &[]) { | 225 | if ty.impls_trait(db, iter_trait, &[]) { |
226 | let assoc_type_item = iter_trait.items(db).into_iter().find_map(|item| match item { | 226 | let assoc_type_item = iter_trait.items(db).into_iter().find_map(|item| match item { |
227 | hir::AssocItem::TypeAlias(alias) if alias.name(db) == known::Item => Some(alias), | 227 | hir::AssocItem::TypeAlias(alias) if alias.name(db) == known::Item => Some(alias), |