introduce ids module

This commit is contained in:
Aleksey Kladov 2019-01-01 22:47:10 +03:00
parent fca1422ea3
commit 9c65e61849
2 changed files with 34 additions and 14 deletions

View file

@ -22,6 +22,7 @@ mod path;
mod arena;
pub mod source_binder;
mod ids;
mod macros;
mod name;
mod krate;
@ -46,6 +47,7 @@ pub use self::{
path::{Path, PathKind},
name::Name,
krate::Crate,
ids::MFileId,
macros::{MacroDef, MacroInput, MacroExpansion, MacroCallId, MacroCallLoc},
module::{Module, ModuleId, Problem, nameres::{ItemMap, PerNs, Namespace}, ModuleScope, Resolution},
function::{Function, FnScopes},
@ -55,20 +57,6 @@ pub use self::{
pub use self::function::FnSignatureInfo;
/// An `MFileId` is like a `FileId`, but it can also refer to code generated by
/// macros.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum MFileId {
File(FileId),
Macro(MacroCallId),
}
impl From<FileId> for MFileId {
fn from(file_id: FileId) -> MFileId {
MFileId::File(file_id)
}
}
/// Def's are a core concept of hir. A `Def` is an Item (function, module, etc)
/// in a specific module.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]