mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Save a bit on empty item trees by deduplicating them
This commit is contained in:
parent
3168ab5b99
commit
5548aecdca
8 changed files with 76 additions and 43 deletions
|
@ -188,7 +188,7 @@ impl TyExt for Ty {
|
|||
fn as_generic_def(&self, db: &dyn HirDatabase) -> Option<GenericDefId> {
|
||||
match *self.kind(Interner) {
|
||||
TyKind::Adt(AdtId(adt), ..) => Some(adt.into()),
|
||||
TyKind::FnDef(callable, ..) => Some(GenericDefId::from(
|
||||
TyKind::FnDef(callable, ..) => Some(GenericDefId::from_callable(
|
||||
db.upcast(),
|
||||
db.lookup_intern_callable_def(callable.into()),
|
||||
)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue