about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-03-16 05:50:38 -0400
committerNiko Matsakis <niko@alum.mit.edu>2016-03-25 14:07:19 -0400
commitab9b8441468aed505f83a2ddf74454f9cdfeab33 (patch)
tree394e51e1cd844943a88d9c0b20a9a7fab1e5fa61 /src/librustc_metadata/decoder.rs
parent6056c5fbedb3681f9fe5efa5f9befe7ff2f91e73 (diff)
downloadrust-ab9b8441468aed505f83a2ddf74454f9cdfeab33.tar.gz
rust-ab9b8441468aed505f83a2ddf74454f9cdfeab33.zip
track the extern-crate def-id rather than path
We used to track, for each crate, a path that led to the extern-crate
that imported it. Instead of that, track the def-id of the extern crate,
along with a bit more information, and derive the path on the fly.
Diffstat (limited to 'src/librustc_metadata/decoder.rs')
-rw-r--r--src/librustc_metadata/decoder.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs
index 562525e956a..561248fc703 100644
--- a/src/librustc_metadata/decoder.rs
+++ b/src/librustc_metadata/decoder.rs
@@ -1763,7 +1763,9 @@ pub fn closure_ty<'tcx>(cdata: Cmd, closure_id: DefIndex, tcx: &TyCtxt<'tcx>)
         .parse_closure_ty()
 }
 
-fn def_key(item_doc: rbml::Doc) -> hir_map::DefKey {
+pub fn def_key(cdata: Cmd, id: DefIndex) -> hir_map::DefKey {
+    debug!("def_key: id={:?}", id);
+    let item_doc = cdata.lookup_item(id);
     match reader::maybe_get_doc(item_doc, tag_def_key) {
         Some(def_key_doc) => {
             let mut decoder = reader::Decoder::new(def_key_doc);