aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-11 07:01:58 +0100
committerGitHub <[email protected]>2019-10-11 07:01:58 +0100
commitef6ccd75e0961956cb8bd07c59382f85da1dadd3 (patch)
treec51b9acd97d0f3a336a8473b743e468cd570224c /crates/ra_hir/src
parent3b4c506f338d03a633419459bb32daf331153d5e (diff)
parent0d0a444d4380d9d1eb580d862b2376b9693d77f3 (diff)
Merge #1991
1991: Use `original_file` instead of `as_original_file` r=matklad a=sinkuu I saw ra_lsp_server panics originating from `as_original_file`, though I have not been able to reproduce. Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ids.rs10
1 files changed, 0 insertions, 10 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs
index a3b65cc79..85b022744 100644
--- a/crates/ra_hir/src/ids.rs
+++ b/crates/ra_hir/src/ids.rs
@@ -50,16 +50,6 @@ impl HirFileId {
50 } 50 }
51 } 51 }
52 52
53 /// XXX: this is a temporary function, which should go away when we implement the
54 /// nameresolution+macro expansion combo. Prefer using `original_file` if
55 /// possible.
56 pub fn as_original_file(self) -> FileId {
57 match self.0 {
58 HirFileIdRepr::File(file_id) => file_id,
59 HirFileIdRepr::Macro(_r) => panic!("macro generated file: {:?}", self),
60 }
61 }
62
63 /// Get the crate which the macro lives in, if it is a macro file. 53 /// Get the crate which the macro lives in, if it is a macro file.
64 pub(crate) fn macro_crate(self, db: &impl AstDatabase) -> Option<Crate> { 54 pub(crate) fn macro_crate(self, db: &impl AstDatabase) -> Option<Crate> {
65 match self.0 { 55 match self.0 {