From 0242acae5388188c06d826f4aed41eee3e91d018 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 16 Feb 2019 21:09:58 +0100 Subject: 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. --- crates/ra_hir/src/ids.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (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 8d81d5ebf..3e11dd6ad 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -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), -- cgit v1.2.3