From 9cb02fd931f436a7b39c33c752799f5530b8491b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 6 Jan 2019 15:16:21 +0300 Subject: kill old module --- crates/ra_hir/src/ids.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src/ids.rs') diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 4d6378e02..c7391ee05 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -2,7 +2,9 @@ use ra_db::{SourceRootId, LocationIntener, Cancelable, FileId}; use ra_syntax::{SourceFileNode, SyntaxKind, SyntaxNode, SyntaxNodeRef, SourceFile, AstNode, ast}; use ra_arena::{Arena, RawId, impl_arena_id}; -use crate::{HirDatabase, PerNs, ModuleId, Module, Def, Function, Struct, Enum, ImplBlock, Crate}; +use crate::{HirDatabase, PerNs, ModuleId, Def, Function, Struct, Enum, ImplBlock, Crate}; + +use crate::code_model_api::Module; /// hir makes a heavy use of ids: integer (u32) handlers to various things. You /// can think of id as a pointer (but without a lifetime) or a file descriptor @@ -151,7 +153,7 @@ impl DefId { let loc = self.loc(db); let res = match loc.kind { DefKind::Module => { - let module = Module::new(db, loc.source_root_id, loc.module_id)?; + let module = Module::from_module_id(db, loc.source_root_id, loc.module_id)?; Def::Module(module) } DefKind::Function => { @@ -175,12 +177,12 @@ impl DefId { /// For a module, returns that module; for any other def, returns the containing module. pub fn module(self, db: &impl HirDatabase) -> Cancelable { let loc = self.loc(db); - Module::new(db, loc.source_root_id, loc.module_id) + Module::from_module_id(db, loc.source_root_id, loc.module_id) } /// Returns the containing crate. pub fn krate(&self, db: &impl HirDatabase) -> Cancelable> { - Ok(self.module(db)?.krate(db)) + Ok(self.module(db)?.krate(db)?) } /// Returns the containing impl block, if this is an impl item. -- cgit v1.2.3