move hygiene to hir_expand
This commit is contained in:
@@ -8,6 +8,7 @@ pub mod db;
|
||||
pub mod ast_id_map;
|
||||
pub mod either;
|
||||
pub mod name;
|
||||
pub mod hygiene;
|
||||
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
@@ -61,17 +62,6 @@ impl HirFileId {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the crate which the macro lives in, if it is a macro file.
|
||||
pub fn macro_crate(self, db: &dyn db::AstDatabase) -> Option<CrateId> {
|
||||
match self.0 {
|
||||
HirFileIdRepr::FileId(_) => None,
|
||||
HirFileIdRepr::MacroFile(macro_file) => {
|
||||
let loc = db.lookup_intern_macro(macro_file.macro_call_id);
|
||||
Some(loc.def.krate)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user