mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Add Loc2IdMap
This commit is contained in:
parent
f1d8558cd5
commit
cb22a799d6
6 changed files with 84 additions and 0 deletions
|
@ -58,6 +58,15 @@ enum ModuleSourceNode {
|
|||
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
|
||||
pub(crate) struct ModuleId(u32);
|
||||
|
||||
impl crate::loc2id::NumericId for ModuleId {
|
||||
fn from_u32(id: u32) -> Self {
|
||||
ModuleId(id)
|
||||
}
|
||||
fn to_u32(self) -> u32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||
pub(crate) struct LinkId(u32);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue