ModuleSource is ItemSource

This commit is contained in:
Aleksey Kladov 2018-12-04 22:46:23 +03:00
parent a9e4142f43
commit 45fce90349
4 changed files with 40 additions and 51 deletions

View file

@ -190,10 +190,7 @@ impl AnalysisImpl {
Some(it) => it,
};
let root = descr.crate_root();
let file_id = root
.source()
.as_file()
.expect("root module always has a file as a source");
let file_id = root.source().file_id();
let crate_graph = self.db.crate_graph();
let crate_id = crate_graph.crate_id_for_crate_root(file_id);