mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Move enum&union to new loc
This commit is contained in:
parent
f135a8ea55
commit
56710f119b
14 changed files with 123 additions and 79 deletions
|
@ -14,7 +14,7 @@ use hir_def::{
|
|||
path::{GenericArg, Path, PathKind, PathSegment},
|
||||
resolver::{HasResolver, Resolver, TypeNs},
|
||||
type_ref::{TypeBound, TypeRef},
|
||||
AdtId, AstItemDef, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId,
|
||||
AdtId, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId,
|
||||
LocalStructFieldId, Lookup, StaticId, StructId, TraitId, TypeAliasId, UnionId, VariantId,
|
||||
};
|
||||
use ra_arena::map::ArenaMap;
|
||||
|
@ -698,10 +698,11 @@ impl_froms!(CallableDef: FunctionId, StructId, EnumVariantId);
|
|||
impl CallableDef {
|
||||
pub fn krate(self, db: &impl HirDatabase) -> CrateId {
|
||||
match self {
|
||||
CallableDef::FunctionId(f) => f.lookup(db).module(db).krate,
|
||||
CallableDef::StructId(s) => s.lookup(db).container.krate,
|
||||
CallableDef::EnumVariantId(e) => e.parent.module(db).krate,
|
||||
CallableDef::FunctionId(f) => f.lookup(db).module(db),
|
||||
CallableDef::StructId(s) => s.lookup(db).container,
|
||||
CallableDef::EnumVariantId(e) => e.parent.lookup(db).container,
|
||||
}
|
||||
.krate
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue