mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Merge pull request #18074 from ChayimFriedman2/typeref-source-map
internal: Build source map for `hir_def::TypeRef`s
This commit is contained in:
commit
80e9d014be
46 changed files with 2511 additions and 929 deletions
|
@ -2424,8 +2424,8 @@ impl SelfParam {
|
|||
func_data
|
||||
.params
|
||||
.first()
|
||||
.map(|param| match &**param {
|
||||
TypeRef::Reference(.., mutability) => match mutability {
|
||||
.map(|¶m| match &func_data.types_map[param] {
|
||||
TypeRef::Reference(ref_) => match ref_.mutability {
|
||||
hir_def::type_ref::Mutability::Shared => Access::Shared,
|
||||
hir_def::type_ref::Mutability::Mut => Access::Exclusive,
|
||||
},
|
||||
|
@ -2751,10 +2751,6 @@ impl TypeAlias {
|
|||
Module { id: self.id.module(db.upcast()) }
|
||||
}
|
||||
|
||||
pub fn type_ref(self, db: &dyn HirDatabase) -> Option<TypeRef> {
|
||||
db.type_alias_data(self.id).type_ref.as_deref().cloned()
|
||||
}
|
||||
|
||||
pub fn ty(self, db: &dyn HirDatabase) -> Type {
|
||||
Type::from_def(db, self.id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue