Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/files.rs')
-rw-r--r--crates/hir-expand/src/files.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir-expand/src/files.rs b/crates/hir-expand/src/files.rs
index c34570fcb5..e6c5bcd1c9 100644
--- a/crates/hir-expand/src/files.rs
+++ b/crates/hir-expand/src/files.rs
@@ -77,6 +77,9 @@ impl<N: AstIdNode> AstId<N> {
pub fn to_ptr(&self, db: &dyn ExpandDatabase) -> AstPtr<N> {
db.ast_id_map(self.file_id).get(self.value)
}
+ pub fn erase(&self) -> ErasedAstId {
+ crate::InFile::new(self.file_id, self.value.erase())
+ }
}
pub type ErasedAstId = crate::InFile<ErasedFileAstId>;