mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Record import source IDs
This commit is contained in:
parent
4bed01c36e
commit
992b928a93
7 changed files with 217 additions and 157 deletions
|
@ -109,6 +109,17 @@ impl CrateRootModuleId {
|
|||
}
|
||||
}
|
||||
|
||||
impl PartialEq<ModuleId> for CrateRootModuleId {
|
||||
fn eq(&self, other: &ModuleId) -> bool {
|
||||
other.block.is_none() && other.local_id == DefMap::ROOT && self.krate == other.krate
|
||||
}
|
||||
}
|
||||
impl PartialEq<CrateRootModuleId> for ModuleId {
|
||||
fn eq(&self, other: &CrateRootModuleId) -> bool {
|
||||
other == self
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CrateRootModuleId> for ModuleId {
|
||||
fn from(CrateRootModuleId { krate }: CrateRootModuleId) -> Self {
|
||||
ModuleId { krate, block: None, local_id: DefMap::ROOT }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue