Turn ImplBlock into a copy type just containing IDs

This makes it more like the other code model types.

Also make Module::definition_source/declaration_source return HirFileIds, to
make them more like the other source functions.
This commit is contained in:
Florian Diebold 2019-02-16 21:09:58 +01:00
parent 6932b77093
commit 0242acae53
9 changed files with 65 additions and 77 deletions

View file

@ -74,7 +74,10 @@ impl HirFileId {
}
}
pub(crate) fn as_original_file(self) -> FileId {
/// XXX: this is a temporary function, which should go away when we implement the
/// nameresolution+macro expansion combo. Prefer using `original_file` if
/// possible.
pub fn as_original_file(self) -> FileId {
match self.0 {
HirFileIdRepr::File(file_id) => file_id,
HirFileIdRepr::Macro(_r) => panic!("macro generated file: {:?}", self),