This commit is contained in:
Lukas Tobias Wirth 2021-05-05 22:55:12 +02:00
parent d26fb188c1
commit 3f796fea9f
6 changed files with 38 additions and 39 deletions

View file

@ -218,9 +218,7 @@ fn hint_iterator(
ty: &hir::Type,
) -> Option<SmolStr> {
let db = sema.db;
let strukt = std::iter::successors(Some(ty.clone()), |ty| ty.remove_ref())
.last()
.and_then(|strukt| strukt.as_adt())?;
let strukt = ty.strip_references().as_adt()?;
let krate = strukt.krate(db);
if krate != famous_defs.core()? {
return None;