diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-12 16:53:32 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-12 16:53:32 +0100 |
commit | ef33953c70e361e8ab6b0bb6b0f5604e1f1c7f29 (patch) | |
tree | 225d7ef3d9dea84757125f9185367db2a02dcd52 /crates | |
parent | 3f96c9b3cc214ded2e9326a0e65ce02b5ea2bd65 (diff) | |
parent | ed59512d02b5194d362ab6842b66803a334ca40e (diff) |
Merge #6205
6205: Fix iterator hint shortening heuristic r=SomeoneToIgnore a=Veykril
Turns out I made a mistake with the heuristic check which is always true, so all iterators exposed from `core` were shortened, including things like ranges. 😅
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates')
-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), |