From 7de6eaa58ae994a5c5d39a66253e347fb039fa94 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 29 Oct 2019 16:01:14 +0300 Subject: remove not that useful indirection --- crates/ra_hir_expand/src/lib.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'crates/ra_hir_expand/src/lib.rs') diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index a31b9fa4c..9100bd15c 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs @@ -1,8 +1,8 @@ -//! `ra_hir_def` contains initial "phases" of the compiler. Roughly, everything -//! before types. +//! `ra_hir_expand` deals with macro expansion. //! -//! Note that we are in the process of moving parts of `ra_hir` into -//! `ra_hir_def`, so this crates doesn't contain a lot at the moment. +//! Specifically, it implements a concept of `MacroFile` -- a file whose syntax +//! tree originates not from the text of some `FileId`, but from some macro +//! expansion. pub mod db; pub mod ast_id_map; @@ -116,22 +116,12 @@ pub struct MacroCallLoc { } impl MacroCallId { - pub fn loc(self, db: &impl AstDatabase) -> MacroCallLoc { - db.lookup_intern_macro(self) - } - pub fn as_file(self, kind: MacroFileKind) -> HirFileId { let macro_file = MacroFile { macro_call_id: self, macro_file_kind: kind }; macro_file.into() } } -impl MacroCallLoc { - pub fn id(self, db: &impl AstDatabase) -> MacroCallId { - db.intern_macro(self) - } -} - /// `AstId` points to an AST node in any file. /// /// It is stable across reparses, and can be used as salsa key/value. -- cgit v1.2.3