hir: resolve associated items in docs (excl. type aliases)

This commit is contained in:
Grégoire Geis 2023-11-19 17:23:08 +09:00
parent d987137b4e
commit fe6f931ac2
3 changed files with 102 additions and 12 deletions

View file

@ -4121,6 +4121,10 @@ impl Type {
}
}
pub(crate) fn canonical(&self) -> Canonical<Ty> {
hir_ty::replace_errors_with_variables(&self.ty)
}
/// Returns types that this type dereferences to (including this type itself). The returned
/// iterator won't yield the same type more than once even if the deref chain contains a cycle.
pub fn autoderef(&self, db: &dyn HirDatabase) -> impl Iterator<Item = Type> + '_ {